Fix HSL transformation for white and black images
Fix HSL, HSV, HCI and HCY transformations for white and black images
Basically, the transformations are substituted with their chroma-based counterparts, with clever sliding on the edges of the triangle.
The new filters behave a bit differently, therefore the patch adds a "Compatibility Mode" switch for the filter. It enables old behavior.
https://bugs.kde.org/show_bug.cgi?id=411863
Test Plan
Testcase 1:
- Open any image with a lot of dark and light areas
- Press Ctrl+U to open HSV-filter
- Select "Hue/Saturation/Lightness" (default choice)
- Try to increase/decrease "Lightness"
- Try to increase/decrease "Saturation"
- Repeat for HSV, HCI and HCY modes
- Compare with "Compatibility Mode", which it old implementation
Testcase 2:
- Create an image with HSV filter layer or mask in Krita 4.2.7 AppImage
- Try to load this image in this version. It should
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.