summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--info/blueshift.texinfo16
-rw-r--r--src/blackbody.py2
-rw-r--r--src/curve.py2
3 files changed, 18 insertions, 2 deletions
diff --git a/info/blueshift.texinfo b/info/blueshift.texinfo
index 4cf1ac6..24f0f33 100644
--- a/info/blueshift.texinfo
+++ b/info/blueshift.texinfo
@@ -1849,6 +1849,22 @@ Approximate average colour temperature of a clear blue poleward sky.
@c https://en.wikipedia.org/wiki/Colour_temperature
@end table
+The functions @code{temperature} (@code{rgb_temperature})
+and @code{cie_temperature} allow you to, instead of specifing
+a colour temperature using literals or these constants,
+use the proper name of this constants. For example,
+if you use the string `@code{xenon short-arc lamp}'
+as the first argument (the temperature value) for the
+function @code{temperature}, @code{K_XENON_SHORT_ARC_LAMP}
+(6200 kelvins) will be used. These functions utilise
+the function @code{kelvins} that does this resolution.
+@code{kelvins} kelvins takes either a numerical value
+an returns it or takes a string and resolves it.
+Predefined recognised punctuation (dot and hyphen)
+and regular blank space is converted into underscores,
+than the string it converted to upper case and prefixed
+with `@code{K_}'. The string is then evaluated without
+any sanity-checks, it should match one of the constants.
@node Configuration examples
diff --git a/src/blackbody.py b/src/blackbody.py
index 686f94e..9b9352c 100644
--- a/src/blackbody.py
+++ b/src/blackbody.py
@@ -683,7 +683,7 @@ def clip_whitepoint(rgb):
return [min(max(0, x), 1) for x in rgb]
-def kelvins(temperature): # TODO demo and document this
+def kelvins(temperature): # TODO demo this
'''
Resolve and colour temperature name
diff --git a/src/curve.py b/src/curve.py
index 24e7330..034be46 100644
--- a/src/curve.py
+++ b/src/curve.py
@@ -73,7 +73,7 @@ def rgb_temperature(temperature, algorithm):
@param algorithm:(float)→(float, float, float) Algorithm for calculating a white point, for example `cmf_10deg`
'''
# Resolve colour temperature name
- temperature = kelvins(temperature) # TODO demo and document this and add to textconf and lisp-esque
+ temperature = kelvins(temperature) # TODO demo this and add to textconf and lisp-esque
# Do nothing if the temperature is neutral
if temperature == 6500: return
# Otherwise manipulate the colour curves