From da67a3b4652dfd8f61999e83b43896a23cc08fc5 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 16 Mar 2014 18:31:01 +0100 Subject: fix cie_invert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/curve.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/curve.py b/src/curve.py index cac2b53..23a77cb 100644 --- a/src/curve.py +++ b/src/curve.py @@ -389,11 +389,12 @@ def cie_invert(r = True, g = None, b = None): ''' if g is None: g = r if b is None: b = r - for (curve, setting) in curves(r, g, b): - if setting: - for i in range(i_size): - (x, y, Y) = srgb_to_ciexyy(r_curve[i], g_curve[i], b_curve[i]) - (r_curve[i], g_curve[i], b_curve[i]) = ciexyy_to_srgb(x, y, 1 - Y) + for i in range(i_size): + (x, y, Y) = srgb_to_ciexyy(r_curve[i], g_curve[i], b_curve[i]) + (r_, g_, b_) = ciexyy_to_srgb(x, y, 1 - Y) + if r: r_curve[i] = r_ + if g: g_curve[i] = g_ + if b: b_curve[i] = b_ def sigmoid(r, g, b): -- cgit v1.2.3-70-g09d2