summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-25 13:31:05 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-25 13:31:05 +0100
commit778ff35c7984abe0a927a116674e509de3048ced (patch)
tree3b44b6a36568512fc09ceeac3d3e11203fcd2225 /src
parentfinish bedtime example (diff)
downloadblueshift-1.14.tar.gz
blueshift-1.14.tar.bz2
blueshift-1.14.tar.xz
fix interpolation at calculate of correlated colour temperature1.14
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/blackbody.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/blackbody.py b/src/blackbody.py
index 42fc6ff..bd29318 100644
--- a/src/blackbody.py
+++ b/src/blackbody.py
@@ -92,8 +92,8 @@ def cmf_2deg(temperature):
(x1, y1) = cmf_2deg_cache[int(temp // 100)]
(x2, y2) = cmf_2deg_cache[int(temp // 100 + 1)]
temp = (temp % 100) / 100
- x = x1 * temp + x2 * (1 - temp)
- y = y1 * temp + y2 * (1 - temp)
+ x = x1 * (1 - temp) + x2 * temp
+ y = y1 * (1 - temp) + y2 * temp
return ciexyy_to_srgb(x, y, 1.0)
@@ -123,8 +123,8 @@ def cmf_10deg(temperature):
(x1, y1) = cmf_10deg_cache[int(temp // 100)]
(x2, y2) = cmf_10deg_cache[int(temp // 100 + 1)]
temp = (temp % 100) / 100
- x = x1 * temp + x2 * (1 - temp)
- y = y1 * temp + y2 * (1 - temp)
+ x = x1 * (1 - temp) + x2 * temp
+ y = y1 * (1 - temp) + y2 * temp
return ciexyy_to_srgb(x, y, 1)
@@ -168,9 +168,9 @@ def redshift(temperature, old_version = False, linear_interpolation = False):
temp = (temp % 100) / 100
if linear_interpolation:
(r, g, b) = standard_to_linear(r, g, b)
- r = r1 * temp + r2 * (1 - temp)
- g = g1 * temp + g2 * (1 - temp)
- b = b1 * temp + b2 * (1 - temp)
+ r = r1 * (1 - temp) + r2 * temp
+ g = g1 * (1 - temp) + g2 * temp
+ b = b1 * (1 - temp) + b2 * temp
if linear_interpolation:
(r, g, b) = linear_to_standard(r, g, b)
return (r, g, b)