Internal colour selector
Open, WishlistPublic

Description

We need an internal colour selector, so that we can allow filters and the like to access wide gamut colours.

I am not supossed to touch T2337 anymore due GSOC regulations, so this goes here:

Okay, so this gsoc I got the following done:

  • softproofing, per image, per view.
  • gamut-warnings.
  • adaptation state slider.
  • Configuration is stored within the kra file.
  • a default setup in the settings, but the actual configuration is in image properties.
  • OCIO look support.
  • a spinbox selector that can select HDR and wide gamut values without hassle.
  • an onscreen color picker
  • a fancy wide-gamut color selector.
  • a dialog that combines these things into a nice little UI file. Working both modally and non-modally.

Bugs:

  • The HSV and HSL modes do something weird with grayscale values. The result seems to give actual colors, but I have no clue what is causing either error.
    • HSL is now fixed, but HSV has an error in the actual conversion, I think. Was an 'undefined' value [done]
  • I can't seem to get the display renderer updating to work properly. [done]

Other priority todos:

  • Figure out inheritance mess, and then stick this/these widgets everywhere.
    • libs/ui/layerstyles/WdgColorOverlay.ui
    • libs/ui/layerstyles/WdgSatin.ui
    • libs/ui/layerstyles/WdgStroke.ui
    • libs/ui/layerstyles/wdgBevelAndEmboss.ui
    • libs/ui/layerstyles/wdgInnerGlow.ui
    • libs/ui/layerstyles/wdgdropshadow.ui
    • plugins/dockers/animation/onion_skins_docker.ui
    • plugins/filters/indexcolors/kiswdgindexcolors.cpp
    • plugins/filters/indexcolors/kiswdgindexcolors.h
    • plugins/impex/jpeg/kis_wdg_options_jpeg.ui
    • plugins/impex/png/kis_wdg_options_png.ui
    • libs/ui/dialogs/kis_dlg_image_properties.cc
    • libs/ui/dialogs/kis_dlg_image_properties.h
    • libs/ui/dialogs/kis_dlg_preferences.cc
    • libs/ui/dialogs/kis_dlg_preferences.h
    • libs/ui/recorder/kis_recorded_paint_action_editor.cc
    • libs/ui/recorder/kis_recorded_paint_action_editor.h
    • plugins/dockers/digitalmixer/digitalmixer_dock.cc
    • plugins/dockers/digitalmixer/digitalmixer_dock.h
    • plugins/dockers/griddocker/grid_config_widget.ui
    • plugins/extensions/gmic/kis_gmic_settings_widget.cpp
    • plugins/flake/textshape/dialogs/CharacterHighlighting.ui
    • plugins/flake/textshape/dialogs/FontDecorations.ui
    • plugins/flake/textshape/dialogs/ParagraphDecorations.ui
    • plugins/generators/pattern/wdgpatternoptions.ui
    • libs/widgets/CMakeLists.txt
    • libs/widgets/KoColorPopupAction.cpp
    • libs/widgets/KoColorPopupAction.h
    • libs/widgets/KoFillConfigWidget.cpp
    • libs/widgets/KoGradientEditWidget.cpp
    • libs/widgets/KoGradientEditWidget.h
    • libs/widgets/KoShadowConfigWidget.cpp
    • libs/widgets/KoStrokeConfigWidget.cpp
    • plugins/flake/textshape/TextTool.cpp
    • plugins/flake/textshape/TextTool.h
    • plugins/flake/textshape/dialogs/SimpleTableWidget.cpp
    • plugins/tools/karbonplugins/filtereffects/FloodEffectConfigWidget.cpp
    • plugins/tools/karbonplugins/filtereffects/FloodEffectConfigWidget.h

Missing elements:

  • Hex code input. [DONE]
  • Palette input. I wasn't too sure how to tackle this one yet.
    • It seems QColorDialog has a public function to access it's custom colors, might be useful to pull that from the system into s KoColorSet sometime. - > We decided it wasn't necessary.
  • OCIO widget: I need more time for this.

Other:

  • The visual color selector has a class named 'visual color selector shape' which deals with all the painting and that is then subclasses by the rectangle shape. We can thus extend this easily to other shapes.
  • That would mean we could replace the pop-up triangle with a wide-gamut variant too. [DONE]
  • The visual color selector is capable of a lot of things, but there's no gui for configuring this yet, and I think we'd need to sit down and think a bit about this. [DONE] (Uses the advanced color selector config)

Details

Commits
R37:4ad25e520581: Fix pop-up palette.
R37:1808f93a6b3c: Make the triangle color selector a bit more pleasant to work with.
R37:6420c8e94a1d: Hide alpha spinbox completely.
R37:e60c1868362d: Fix the next/previous colors and update them properly.
R37:c34c1d5e5343: The visual color selector should probably sent out color updates, regardless of…
R37:bc2ecd68775e: Disable rightclick on the visual color selector for now.
R37:93ef7c8ef97e: Merge in new internal color picker dialog!
R37:27d4034efe5d: Fix screencolor picker label.
R37:29d34d885455: Fix color conversion issues with the selector.
R37:16c8832c9342: Port the last areas to use the KisColorButton as far as possible.
R37:d635b53e2586: Make the UI layout of the internal color selector a little nicer.
R37:23dcf5d9d0f3: Replace kcolorbutton with new kiscolorbutton in several places.
R37:1afa4384e84f: Use internal visual selector in the Pop-up palette.
R37:9a07179d79d8: Fix updating in modal dialog.
R37:de26f01fcd45: Check for colorspaces with or not and, a cs can't be all at the same time.
R37:389c2bd5123a: Fork KColorButton, make it use internal selector dialog.
R37:c71c0b696915: Add config struct to kisinternalcolorselector
R37:6995071af937: Use Advanced Color Selector Configuration to set visual's shape, P1
R37:763a373b26cc: Add Hex code widget that only outputs and reads sRGB colors.
R37:fbc74f151215: Add colorspace locking to the internal selector.
R37:b97cef85d33e: Allow the modal dialog to have ok/cancel buttons as well.
R37:960bde483a5f: Make color selector faster.
R37:73eb12ee2571: Add a little combobox that allows you to search the palette colornames
R37:541b596e7454: Make drawing the image slightly faster.
R37:6655f984354d: Add display color converters to the KoColorSetWidget/KoColorPatch
R37:b5a0d6c36c15: Fix selector on single-dimension hue wheel, also rotate hue.
R37:8737642881dc: Add triangle and elliptical visual selectors and set default to ring+triangle
R37:d09605cbaefe: Fix HSV mode
R37:5282f861e57e: Do clamping in color space traits properly.
R37:589b5c645eb2: Fix display configuration updating.
R37:9acd7f1558a3: Fix HSL and HSV
R37:31931e3a522e: Add visual selector shapes.
R37:ea0867829348: Give spinboxes names, fix order spinboxes, do cleanup.
R37:6f18c4c3272a: Make internal color selector dialog possible to do modal mode.
R37:38398393973f: Remove signal compressor, use block signals instead.
R37:55350f021cb5: Move KoDualColorButton, attach internal color selector.

I like your mockup @woltherav , I would miss only Hex color on it, and I think alpha/transparency/opacity is a must have.

Here is two screenshots commented to add a feedback to this thread.
Color selector dialog, what I like:

Color selector dialog, what I dislike:

@Deevad thanks. The internal color selector is proly not gonna be palettised as the whole point is to allow, say, color-to-alpha to use wide-gamut values and convert those to transparency.

I would like to avoid doing anythinglike the triangular selector for now. I've had trouble with conversion from/to hsv due to rounding errors, so to start with I just want a really really good channel-based selector, and then later worry about HSV/HSL/Whatever.

woltherav moved this task from Backlog to Wolthera's tasks on the Krita board.May 6 2016, 1:44 PM
Deevad added a comment.May 6 2016, 2:04 PM

@woltherav Ok, good to know: I didn't knew this type of color-wheel was creating troubles with conversion. Thank you for the answer.

+1 about "I just want a really really good channel-based selector". I like the Specific Color Selector or the "color slider" docker you made. ( interactive drag colored strip per channel + field to enter a number on right )

sbrown added a subscriber: sbrown.May 6 2016, 3:32 PM

A nice thing that Mari's color picker has is an intensity slider that goes above 1, and that works on a logarithmic scale. It makes mixing HDR colors a lot easier. Might be worth considering if you get to an hsv/hsy style selector at some point.

So, while this part of the project is rather slow, I have the feeling I am doing good by making it as sturdy as possible while minimalising the complications. There's two main issues with color selectors:

One is that color management is complicated.

The other is best described as 'signal slot hell' and it's why I am taking this project so slowly. Overcomplicated code can ruin everything.

Generally, I keep finding new simpler solutions to certain coding problems, so I am confident about this approach.

I am feeling pretty good about myself right now:

http://imgur.com/a/g7ubn

It is still a bit clunky, odd, and needs to have the display selectors make use of it, but that is a wide-gamut HSL color selector.

woltherav updated the task description. (Show Details)Aug 17 2016, 11:02 AM
woltherav updated the task description. (Show Details)Aug 17 2016, 1:46 PM
woltherav updated the task description. (Show Details)Aug 17 2016, 2:08 PM
woltherav updated the task description. (Show Details)
woltherav updated the task description. (Show Details)Aug 20 2016, 12:50 PM

Current state pictures:

woltherav updated the task description. (Show Details)Aug 29 2016, 10:03 AM
woltherav updated the task description. (Show Details)Sep 1 2016, 9:20 AM
woltherav updated the task description. (Show Details)Sep 2 2016, 10:21 AM
woltherav moved this task from Backlog to Needs merge on the Krita: Next Features board.

This one's merge ready!

The last leftover thing is fiddling with the lightness order, but that requires concentration and isn't a release blocker.

portnov added a subscriber: portnov.Sep 6 2016, 5:55 PM

New popup palette seems to react on right mouse click in a different way than it did before.

  1. in some cases (still cant figure out which exactly) the palette appears and disappears the same moment. It seems it thinks that if i released right mouse button then i do not need the palette anymore. But i do :)
  2. in some other cases (also cant figure out when exactly) the color is selected before i can see what color i am selected. Looks like it is already selecting some color while i'm pressing right mouse button. For some reason, in many cases it selects very saturated and bright colors (may depend on selected Advanced color selector model).

@portnov , I disabled right-click from affecting the palette selection.

That helped, thanks.

(picking off where we left)

well... it's odd, but I don't mind that the foreground color selector dialog is non-modal and the background one is modal. That's just me though.

so I updated the repo and those points were indeed fixed.

For foreground color selector, it only updates the previous color when I select a new color.

The testing plan that was apparantly needed:

  1. Use the pop-up palette on a drawing for at the least an hour.
  2. Use the dialog(press current color swatch), press buttons, etc.
  3. Use either in different color spaces. (Lab, CMYK, sRGB, and of the widegamut RGBs, XYZ, grayscale)
  4. Use either in different color depths.
  5. Check if HDR painting works.
  6. Check if the pop-up palette functions in different configurations.