diff options
author | Thomas White <taw@physics.org> | 2021-11-06 13:28:45 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-11-06 13:28:45 +0100 |
commit | cf899e0439cf4fbfbda8138c3152d540c7838e5f (patch) | |
tree | 735da9b9226962cee8512f5af82a3638ce91b7cf /guile | |
parent | 7208eecd64ab315fa0c1d3113a3793d20491fb73 (diff) |
Add colour-as-rgbw
Diffstat (limited to 'guile')
-rw-r--r-- | guile/starlet/colours.scm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/guile/starlet/colours.scm b/guile/starlet/colours.scm index c7d1de0..f18b986 100644 --- a/guile/starlet/colours.scm +++ b/guile/starlet/colours.scm @@ -27,6 +27,7 @@ make-colour-rgb colour-as-cmy colour-as-rgb + colour-as-rgbw cyan magenta @@ -117,6 +118,15 @@ (make-exception-with-irritants (colour-type col)))))))) +(define (colour-as-rgbw col) + (let ((rgb (colour-as-rgb col))) + (let ((w (apply min rgb))) + (list (- (red rgb) w) + (- (green rgb) w) + (- (blue rgb) w) + w)))) + + (define (colour-as-cmy col) (let ((val (colour-value col))) (case (colour-type col) |