summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 = ...):