summaryrefslogtreecommitdiffstats
path: root/src/curve.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-26 08:53:53 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-26 08:54:01 +0100
commita63b75696de54b7342501e35230b373453ee6d81 (patch)
treeabae485ac155252acc3b7c4eae4041019e55555d /src/curve.py
parentadd missing \n (diff)
downloadblueshift-a63b75696de54b7342501e35230b373453ee6d81.tar.gz
blueshift-a63b75696de54b7342501e35230b373453ee6d81.tar.bz2
blueshift-a63b75696de54b7342501e35230b373453ee6d81.tar.xz
m + add cie_temperature
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/curve.py')
-rw-r--r--src/curve.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/curve.py b/src/curve.py
index cca8a5a..4be11fc 100644
--- a/src/curve.py
+++ b/src/curve.py
@@ -53,15 +53,36 @@ def curves(r, g, b):
def temperature(temperature, algorithm):
'''
- Change colour temperature according to the CIE illuminant series D
+ Change colour temperature according to the CIE illuminant series D using CIE sRBG
+
+ @param temperature:float The blackbody temperature in kelvins
+ @param algorithm:(float)→(float, float, float) Algorithm for calculating a white point, for example `cmf_10deg`
+ '''
+ rgb_temperature(temperature, algorithm)
+
+
+def rgb_temperature(temperature, algorithm):
+ '''
+ Change colour temperature according to the CIE illuminant series D using CIE sRBG
+
+ @param temperature:float The blackbody temperature in kelvins
+ @param algorithm:(float)→(float, float, float) Algorithm for calculating a white point, for example `cmf_10deg`
+ '''
+ if temperature == 6500:
+ return
+ rgb_brightness(*(algorithm(temperature)))
+
+
+def cie_temperature(temperature, algorithm):
+ '''
+ Change colour temperature according to the CIE illuminant series D using CIE xyY
@param temperature:float The blackbody temperature in kelvins
@param algorithm:(float)→(float, float, float) Algorithm for calculating a white point, for example `cmf_10deg`
'''
if temperature == 6500:
return
- (r, g, b) = algorithm(temperature)
- rgb_brightness(r, g, b)
+ cie_brightness(*(algorithm(temperature)))
def rgb_contrast(r, g = ..., b = ...):