aboutsummaryrefslogtreecommitdiff
path: root/guile/starlet/colours.scm
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-04-18 11:35:16 +0200
committerThomas White <taw@physics.org>2021-04-18 11:35:16 +0200
commitb8ed119b2289f0a81e2ada3f2fc8c85ff37de21c (patch)
treed2c0ea5d6bba3c3ddfe1bbd21b5db4c5ea04042c /guile/starlet/colours.scm
parentcd7f92c7a13370048be66e002285fe4b09846d6e (diff)
Add <colour-component-id>
Diffstat (limited to 'guile/starlet/colours.scm')
-rw-r--r--guile/starlet/colours.scm31
1 files changed, 30 insertions, 1 deletions
diff --git a/guile/starlet/colours.scm b/guile/starlet/colours.scm
index 5b2877a..b5ff71b 100644
--- a/guile/starlet/colours.scm
+++ b/guile/starlet/colours.scm
@@ -7,8 +7,21 @@
make-colour-rgb
colour-as-cmy
colour-as-rgb
+
+ cyan
+ magenta
+ yellow
+ red
+ green
+ blue
+
interpolate-colour
- white))
+ white
+
+ <colour-component-id>
+ colour-component-id?
+ colour-component-id
+ get-colour-component))
(define-class <colour> (<object>)
@@ -121,3 +134,19 @@
(make-exception-with-message
"Unrecognised colour interpolation type")
(make-exception-with-irritants interpolation-type))))))
+
+
+(define-class <colour-component-id> (<object>)
+ (component
+ #:init-form (error "Colour component must be specified")
+ #:init-keyword #:component
+ #:getter get-colour-component))
+
+
+(define (colour-component-id? a)
+ (is-a? a <colour-component-id>))
+
+
+(define (colour-component-id a)
+ (make <colour-component-id>
+ #:component a))