From ab75b6858533f8088c02da7e67df8b4f5062902a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 5 Mar 2014 18:48:03 +0100 Subject: buf fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/colour.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/colour.py b/src/colour.py index db51bc1..c169456 100644 --- a/src/colour.py +++ b/src/colour.py @@ -72,7 +72,7 @@ def matrix_mul_vector(matrix, vector): @param vector:list The vector @return :list The resulting vector ''' - return [[r * v for r, v in zip(row, vector)] for row in matrix] + return [sum([r * v for r, v in zip(row, vector)]) for row in matrix] ciexyz_to_linear_matrix = [[ 3.240450, -1.537140, -0.4985320], @@ -151,9 +151,9 @@ def ciexyz_to_cielab(x, y, z): x /= 0.95047 z /= 1.08883 f = lambda c : c ** 1 / 3 if c > 0.00885642 else (7.78 + 703 / 99900) * c + 0.1379310 - l = 116 * f(Y) - 16 - a = 500 * (f(X) - f(Y)) - b = 200 * (f(Y) - f(Z)) + l = 116 * f(y) - 16 + a = 500 * (f(x) - f(y)) + b = 200 * (f(y) - f(z)) return (l, a, b) @@ -172,7 +172,7 @@ def cielab_to_xiexyz(l, a, b): f = lambda c : c ** 3 if c ** 3 > 0.00885642 else (c - 0.1379310) / (7.78 + 703 / 99900) (x, y, z) = [f(c) for c in (x, y, z)] x *= 0.95047 - y *= 1.08883 + z *= 1.08883 return (x, y, z) -- cgit v1.2.3-70-g09d2