summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-15 21:31:30 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-15 21:31:30 +0100
commite71ff4d62dc4ca7c6a134d24ce4ef829670c23cb (patch)
treec49d3aa88592d6b971ef0724315a2dbac5ff9e9a /src
parentprototype for randr usage: inverts the colours (diff)
downloadblueshift-e71ff4d62dc4ca7c6a134d24ce4ef829670c23cb.tar.gz
blueshift-e71ff4d62dc4ca7c6a134d24ce4ef829670c23cb.tar.bz2
blueshift-e71ff4d62dc4ca7c6a134d24ce4ef829670c23cb.tar.xz
add negative
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/__main__.py1
-rw-r--r--src/curve.py14
2 files changed, 15 insertions, 0 deletions
diff --git a/src/__main__.py b/src/__main__.py
index 6ad21ce..cee2f85 100755
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -55,6 +55,7 @@ def periodically(year, month, day, hour, minute, second, weekday, fade):
(**) See https://en.wikipedia.org/wiki/Leap_second
'''
if fade is None:
+ negative(False, False, False)
temperature(6500, lambda T : divide_by_maximum(series_d(T)), True)
temperature(6500, lambda T : clip_whitepoint(simple_whitepoint(T)), True)
temperature(6500, cmf_2deg, True)
diff --git a/src/curve.py b/src/curve.py
index 8a6b28c..34adf29 100644
--- a/src/curve.py
+++ b/src/curve.py
@@ -263,6 +263,20 @@ def gamma(r, g, b):
curve[i] **= level
+def negative(r, g, b):
+ '''
+ Invert the colour curves (negative image)
+
+ @param r:bool Whether to invert the red curve
+ @param g:bool Whether to invert the green curve
+ @param b:bool Whether to invert the blue curve
+ '''
+ for (curve, setting) in curves(r, g, b):
+ if setting:
+ for i in range(i_size):
+ curve[i] = 1 - curve[i]
+
+
def sigmoid(r, g, b):
'''
Apply S-curve correction on the colour curves