diff options
author | Thomas White <taw@physics.org> | 2023-06-15 22:34:51 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-06-15 22:34:51 +0200 |
commit | 1d6f430b10f90b42220125af98829b3ddbe1eed2 (patch) | |
tree | 5b63d63d359ca66dafc6a5baffeb3984dfa51243 /guile/starlet/colours.scm | |
parent | 7b6e2ff3388c12544fbd0ef3623f2724e40d20b9 (diff) |
Remove colour-component stuff
It's a bit of a hack, only needed for MIDI control. I have a better
solution using OSC in mind.
Diffstat (limited to 'guile/starlet/colours.scm')
-rw-r--r-- | guile/starlet/colours.scm | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/guile/starlet/colours.scm b/guile/starlet/colours.scm index cf71567..2162322 100644 --- a/guile/starlet/colours.scm +++ b/guile/starlet/colours.scm @@ -37,13 +37,7 @@ blue interpolate-colour - white - - <colour-component-id> - colour-component-id? - colour-component-id - get-colour-component - extract-colour-component)) + white)) (define-class <colour> (<object>) @@ -167,40 +161,3 @@ (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)) - - -(define (extract-colour-component col component-id) - (cond - ((eq? (get-colour-component component-id) 'cyan) - (cyan (colour-as-cmy col))) - ((eq? (get-colour-component component-id) 'magenta) - (magenta (colour-as-cmy col))) - ((eq? (get-colour-component component-id) 'yellow) - (yellow (colour-as-cmy col))) - ((eq? (get-colour-component component-id) 'red) - (red (colour-as-rgb col))) - ((eq? (get-colour-component component-id) 'green) - (green (colour-as-rgb col))) - ((eq? (get-colour-component component-id) 'blue) - (blue (colour-as-rgb col))) - (else (raise-exception (make-exception - (make-exception-with-message - "Invalid colour component ID") - (make-exception-with-irritants - (get-colour-component component-id))))))) |