r21649 by jghali - #14463: Shade of <100% for Lab colours gives wrong results

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 13 16:59:49 UTC 2016


Author: jghali
Date: Tue Dec 13 16:59:49 2016
New Revision: 21649

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21649
Log:
#14463: Shade of <100% for Lab colours gives wrong results

Modified:
    trunk/Scribus/scribus/sccolorengine.cpp

Modified: trunk/Scribus/scribus/sccolorengine.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21649&path=/trunk/Scribus/scribus/sccolorengine.cpp
==============================================================================
--- trunk/Scribus/scribus/sccolorengine.cpp	(original)
+++ trunk/Scribus/scribus/sccolorengine.cpp	Tue Dec 13 16:59:49 2016
@@ -292,9 +292,9 @@
 	{
 		ScColorTransform trans = doc ? doc->stdLabToCMYKTrans : ScCore->defaultLabToCMYKTrans;
 		double inC[3];
-		inC[0] = color.m_L_val * (level / 100.0);
-		inC[1] = color.m_a_val;
-		inC[2] = color.m_b_val;
+		inC[0] = 100 - (100 - color.m_L_val) * (level / 100.0);
+		inC[1] = color.m_a_val * (level / 100.0);
+		inC[2] = color.m_b_val * (level / 100.0);
 		quint16 outC[4];
 		trans.apply(inC, outC, 1);
 		cmyk.c = outC[0] / 257;
@@ -331,9 +331,9 @@
 	{
 		ScColorTransform trans = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
 		double inC[3];
-		inC[0] = color.m_L_val * (level / 100.0);
-		inC[1] = color.m_a_val;
-		inC[2] = color.m_b_val;
+		inC[0] = 100 - (100 - color.m_L_val) * (level / 100.0);
+		inC[1] = color.m_a_val * (level / 100.0);
+		inC[2] = color.m_b_val * (level / 100.0);
 		quint16 outC[3];
 		trans.apply(inC, outC, 1);
 		rgb.r = outC[0] / 257;
@@ -450,9 +450,9 @@
 	{
 		ScColorTransform trans  = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
 		double inC[3];
-		inC[0] = color.m_L_val * (level / 100.0);
-		inC[1] = color.m_a_val;
-		inC[2] = color.m_b_val;
+		inC[0] = 100 - (100 - color.m_L_val) * (level / 100.0);
+		inC[1] = color.m_a_val * (level / 100.0);
+		inC[2] = color.m_b_val * (level / 100.0);
 		quint16 outC[3];
 		trans.apply(inC, outC, 1);
 		tmp = QColor(outC[0] / 257, outC[1] / 257, outC[2] / 257);
@@ -555,9 +555,9 @@
 	else if (color.getColorModel() == colorModelLab)
 	{
 		double inC[3];
-		inC[0] = color.m_L_val * (level / 100.0);
-		inC[1] = color.m_a_val;
-		inC[2] = color.m_b_val;
+		inC[0] = 100 - (100 - color.m_L_val) * (level / 100.0);
+		inC[1] = color.m_a_val * (level / 100.0);
+		inC[2] = color.m_b_val * (level / 100.0);
 		quint16 outC[3];
 		ScColorTransform trans  = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
 		ScColorTransform transProof   = doc ? doc->stdProofLab   : ScCore->defaultLabToRGBTrans;




More information about the scribus-commit mailing list