Commit Graph

50 Commits

Author SHA1 Message Date
David Capello c444b566e1 Fix painting UI theme colors as they are specified in sRGB color space
Fixes a regression found after merging #5414:
https://github.com/aseprite/aseprite/pull/5414#issuecomment-3286339563

We always expected a sRGB color in ui::Graphics API and we can specify
a color in another color space using the ui::Paint version of its
member functions.

Several functions related to color spaces are now using a ui::Display
to receive the specific display where we're going to paint, instead of
using os::System::instance()->defaultWindow()->colorSpace().
2025-09-16 09:42:35 -03:00
Gaspar Capello 907138d5dd Fix wrong color space in multiple UI elements
This fix solves color space missmatch in the following UI elements:
- Timeline thumbnails
- Palette entries
- Tileset entries
- Color Spectrum and Wheels
- Color Popup Gradients
- Color Button
2025-09-05 14:50:36 -03:00
David Capello 09538f9a1a clang-format all files 2024-12-16 14:52:19 -03:00
David Capello 571b4ec9f2 Update to new laf API (os::System::instance()/make()) 2024-03-05 18:50:24 -03:00
David Capello 3606a54826 Fix eyedropper to pick colors/tiles correctly from flipped tiles
* Added a new app::Color type for tiles, to store the flags of the
  picked tile.
* Fixed color bar/status bar with a new draw_tile() to draw tiles
  with flip flags.
2023-11-09 16:44:46 -03:00
David Capello e78e1e9a54 Remove current_editor, replace with Editor::activeEditor()
Finally removed src/app/modules/editors.h file.
2022-10-20 12:31:22 -03:00
David Capello 83857ea600 Merge branch 'main' into beta 2022-08-17 22:58:12 -03:00
David Capello 4e12e427ef Rename "checked" -> "checkered" (background, drawing routines, etc.)
Also rename setBgCheckedSize -> setBgStripeSize in case we add new
background patterns (like horizontal/vertical/diagonal stripes, etc.)
2022-08-17 22:19:07 -03:00
David Capello ff5afba6ae Merge branch 'main' into beta 2022-05-19 16:55:30 -03:00
David Capello aca96c6d36 Use shaders for ColorTintShadeTone/ColorSpectrum selectors (#960)
This is the first step to optimize the painting code of ColorSelectors
which were using a background thread to paint their
surface. ColorWheel is still using the old method (without shaders).

This impl is already a lot faster on CPU, and it's ready for
GPU-acceleration in a future.
2022-05-17 13:24:53 -03:00
David Capello 7e76d81fcc Merge branch 'main' into beta 2022-02-18 19:32:33 -03:00
David Capello 2d3de1728c Add SkinTheme::get() to avoid using SkinTheme::instance() as much as possible
This was done to avoid some nullptr references using
SkinTheme::instance() (mainly from
StatusBar::IndicatorsGeneration::add()) when the application is being
closed because an exception was thrown. This might be useful to detect
certain kind of crashes from Sentry.
2022-02-18 19:01:46 -03:00
David Capello 9e10a1c82c Merge branch 'main' into beta 2021-09-06 18:30:45 -03:00
David Capello 013792a215 Don't access preferences from background thread and check current_editor existence
Related to #2874 and ac31ee35c0
2021-09-01 12:11:02 -03:00
David Capello 6341fcee23 Add missing #include to use current_editor 2021-09-01 12:02:29 -03:00
Robert Rüdiger ac31ee35c0 Fix translucent backgrounds in color selection 2021-09-01 12:01:59 -03:00
David Capello 5d77b885a1 Minor fix to tiles button 2020-11-09 19:29:35 -03:00
David Capello c2e5e69882 Simplify tilesets impl using tile index 0 = an empty tile
In this way we always have an empty tile available in the drawing
process. We've also added the Tileset::firstVisibleIndex field to
change the visible index of the tile 1 so we can offset the visible
number by the user (just as a visual aid / simulate old tilesets with
index=0=non-empty tile).
2020-10-30 16:33:34 -03:00
David Capello 5ee3ebdd71 Add fg/bg tiles selectors in ColorBar
Now fg/bg colors and fg/bg tiles are different widgets, and the
StatusBar can show tiles when the eyedropper is picking tiles.
2020-08-21 18:28:31 -03:00
David Capello b628e21e76 Replace MIN/MAX() macros with std::min/max() functions 2020-04-08 12:20:53 -03:00
David Capello 95b655168c Use new laf + skia m81 branch
* Some minor refactors due laf changes.
* Updated the instructions to compile Aseprite linking to external
  skia instructions and pre-built packages.
2020-03-01 23:42:08 -03:00
David Capello e3f09525db Refactor the thumbnails generation of cels
A new Render::renderCel() method is used to render the specific cel
thumbnail, useful in the future to render thumbnails of different kind
of layers (e.g. future tilemaps). And now the background is rendered
in a different step (so the thumbnails doesn't contain the
background.)
2019-04-11 14:29:20 -03:00
David Capello a4d8fc52bf Manage color profiles (fix #1576) 2018-10-19 15:30:30 -03:00
David Capello 5cb2d984f0 Rename she -> os 2018-08-09 12:58:43 -03:00
David Capello 0fe5edb7fe Improve performance drawing color selectors (fix #1516, fix #1695) 2018-03-28 23:39:07 -03:00
David Capello 629c359627 Draw alpha slider in ColorSliders correctly 2017-05-30 13:52:53 -03:00
David Capello 1576e42ff2 Add alpha slider in ColorPicker (#707) 2017-05-30 13:38:40 -03:00
David Capello be3c9c1bcc Convert timeline widget to new styles
And remove the old skin::Style.
2017-03-13 18:13:38 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello c09dfa89f0 Show grayscale colors in color buttons when we're editing a grayscale image 2016-02-24 19:37:20 -03:00
David Capello 1aaeacc460 Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.

Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-04 14:39:04 -03:00
David Capello 53a925e86d Remove SkinParts enum
Now we generate the list of SkinTheme parts from the skin.xml file using
the gen utility.

Several refactors included in SkinTheme class to simplify code.
2015-08-04 19:38:52 -03:00
David Capello 318bc2e2f9 Add alpha channel to palette/color bar/color selector (issue #286) 2015-06-30 17:36:37 -03:00
David Capello 21ca87862c Add layer blending modes (fix #318)
- Added doc::BlendMode enum and doc::BlendFunc type
- Renamed LayerImage::getBlendMode() -> blendMode()
- BLEND_MODE_COPY is BlendMode::SRC now
- BLEND_MODE_NORMAL is BlendMode::NORMAL now
- Added app::cmd::SetLayerBlendMode
2015-06-13 21:29:16 -03:00
David Capello 2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -03:00
David Capello ca9df1a05e Rename ui::jguiscale() to ui::guiscale()
* Change Theme::guiscale member to Theme::m_guiscale
2014-11-25 22:33:45 -03:00
David Capello 63995c6f0a Merge "raster" namespace into "doc" library 2014-10-20 22:21:31 -03:00
David Capello 0defe27dc6 Move dotted_mode() from app to she module
Replaced a huge array of marching ant patterns (which was taken
from GIMP 1.3.11) with a simple formula.
2014-10-16 23:52:28 -03:00
David Capello 2b2d0f34b2 Add simpleini to replace Allegro 4 configuration routines 2014-10-16 21:27:25 -03:00
David Capello 4b7bf5b835 Merge she::Color and ui::Color types in gfx::Color 2014-06-28 16:10:39 -03:00
David Capello ed6c0f986d ColorSelector: Add WarningIcon to add colors to the palette
Simplified the color selector UI. Now RGB/HSV colors are shown correctly
and a new warning icon/button is visible when the color is not part of
the current palette. This button can be used to quickly add the new entry
to the palette.
2014-06-01 18:15:11 -03:00
David Capello 0480de4388 Add live preview to tiled mode
- Removed draw_emptyset_symbol() function
- Added DocumentSettingsObserver
- Moved Editor's painting code from onProcessMessage to onPaint
2014-02-06 20:22:52 -03:00
David Capello f8e8657093 Move kPaintMessage code to onPaint() event for some widgets
The affected widgets are: ColorBar::ScrollableView, ColorButton, and
StatusBar.

* Added Graphics::drawLine()
* Moved rectgrid and draw_color to modules/gfx.cpp
2013-12-29 21:12:23 -03:00
David Capello 66f357098c src/app/modules/gfx.cpp: Remove deprecated RectTracker stuff 2013-12-29 20:16:31 -03:00
David Capello f59f6f7d5e Fix bug creating bitmaps with width < 0 in draw_color() function 2013-11-15 15:46:54 -03:00
David Capello 01d79ddf9b Merge branch 'dev' of git@github.com:dacap/aseprite.git into dev 2013-11-09 20:00:16 -03:00
David Capello e5ba8e0922 Encapsulate Image implementation (private members, accessors, iterators, etc.)
- Rename _rgba/_graya to raster::rgba()/graya()
- Add raster::color_t type (alias for uint32_t)
- Rename raster::GfxObj to Object. And GfxObj::getType() to Object::type()
- Move conversion from raster::Image/Palette to Allegro BITMAP/RGB
  to raster/conversion_alleg.h file
- Add raster/color_scales.h
- Rename image_* functions to raster/primitives.h
- Reimplement ink processing with templates instead of macros
2013-11-09 19:59:05 -03:00
David Capello dbf4d0d490 Replace JRect/jrect struct with gfx::Rect
- Replaced Widget::rc -> Widget::m_bounds private member.
- Added Widget::offsetWidgets() method.
- Removed View::displaceWidgets().
2013-10-26 12:50:55 -03:00
David Capello cde54f3682 Change BSD license to MIT in sublibraries and fix headers 2013-08-08 21:01:20 -03:00
David Capello c88f9b172b Refactor: Move app files to src/app subdirectory inside app namespace
- Add HAVE_CONFIG_H wrapper to #include "config.h"
- Removed widgets namespace (it's in app now)
- Move some functions from src/file/file.h to src/base/cfile.h
- Move Vector2d to base library
- Rename MenuItem2 to AppMenuItem
2013-08-05 21:20:19 -03:00