Skip to content

KisVisualColorSelector HSY' fixes (4.3 branch)

This code should fix the HSY' color selection with KisVisualColorSelector. I wasn't really aware it only works in linear gamma.

It used to work with linear color spaces (although the Y' was less nice to use because it lacked the gamma adjustment) but one of my changes broke it completely. Now it should be in a working state for both linear and non-linear RGB profiles, with one caveat:

The current implementation requires non-linear profiles to provide TRCs for the primaries, which the ITUR_2100_PQ_FULL.ICC for example lacks. This also means that profile does not deliver luma coefficients, and while I tried to fix the estimation code, they still seem a bit off compared to the linear Rec2020-elle-V4-g10.icc, not sure if I'm still missing something.

So in the long run (not only for this issue) I guess there's no way around implementing support to use a different profile internally, like the Small Color Selector does for the Rec.2020 case.

Apart from that, I implemented a small change for the "border mirror" ring selector that the popup palette uses instead of a straight slider bar (e.g. for the Y' slider and Hue+Saturation wheel combo), before you could just drag the handle all the way around so you never knew where exactly the maximum and minimum were, now the handle stops at the mirror axis when the cursor moves across it.

Test Plan

To test all things together, use the Y'-slider with Hue+Saturation wheel layout (the top right choice in Advanced Color Selector choices for HSY') and set popuppalette/usevisualcolorselector=true in kritarc, and then play with the popup palette selector in various RGB color profiles, and hopefully get results that match the Advanced Color Selector docker (as long as its sRGB limitation allows).

Note that the Luma coefficients are (still) taken from the color profile and not the Advanced Color Selector configuration, but the Gamma setting is supported now.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports

Loading