Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Try to fix magentas in LAB a little better.

Wolthera van Hövell tot Westerfliereea041949d59
diff --git a/libs/pigment/KoGamutMappingUtils.cpp b/libs/pigment/KoGamutMappingUtils.cpp
index 7e98155eb8..0839ea7a41 100644
--- a/libs/pigment/KoGamutMappingUtils.cpp
+++ b/libs/pigment/KoGamutMappingUtils.cpp
@@ -350,11 +350,14 @@ QPointF KoGamutMappingUtils::cuspForHue(const QMap<float, QPointF> &gamutCuspDes
}
if (foundAngle < 0) foundAngle = gamutCuspDescription.size()-1;
const float angle = gamutCuspDescription.keys().at(foundAngle);
- float nextAngle = gamutCuspDescription.keys().value(foundAngle+1, gamutCuspDescription.keys().first());
+ const float nextAngle = gamutCuspDescription.keys().value(foundAngle+1, gamutCuspDescription.keys().first());
QPointF lch1 = gamutCuspDescription.value(angle);
QPointF lch2 = gamutCuspDescription.value(nextAngle);
- const float t = (hue - angle) / (nextAngle - angle);
+ float t = (hue - angle) / (nextAngle - angle);
+ if (hue < angle) {
+ t = (hue - angle + 1.0) / (nextAngle + 1.0 - angle);
+ }
cusp = QLineF(lch1, lch2).pointAt(t);
return cusp;