From 24502ae320086d927dd6a7eb523a2cb6d7e5e308 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 5 Jun 2023 15:47:04 +0200 Subject: Fixture library: : Add white-weirdness attribute --- guile/starlet/fixture-library/stairville/z120m.scm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'guile/starlet/fixture-library/stairville/z120m.scm') diff --git a/guile/starlet/fixture-library/stairville/z120m.scm b/guile/starlet/fixture-library/stairville/z120m.scm index e1f40af..00fb476 100644 --- a/guile/starlet/fixture-library/stairville/z120m.scm +++ b/guile/starlet/fixture-library/stairville/z120m.scm @@ -26,6 +26,16 @@ #:use-module (starlet colours) #:export ()) + +(define (colour-as-rgbw-weirdness col weirdness) + (let ((rgb (colour-as-rgb col))) + (let ((w (* (- 1 weirdness) (apply min rgb)))) + (list (- (red rgb) w) + (- (green rgb) w) + (- (blue rgb) w) + w)))) + + (define-fixture @@ -34,10 +44,12 @@ (attr-continuous intensity '(0 100) 0) (attr-colour colour white) (attr-continuous strobe-frequency '(1 25) 1) - (attr-list strobe '(off on random) 'off)) + (attr-list strobe '(off on random) 'off) + (attr-continuous white-weirdness '(0 100) 0)) (let ((intensity (get-attr intensity)) - (rgbw (colour-as-rgbw (get-attr colour)))) + (rgbw (colour-as-rgbw-weirdness (get-attr colour) + (/ (get-attr white-weirdness) 100)))) (set-chan8 1 (percent->dmxval8 intensity)) (set-chan8 3 (percent->dmxval8 (car rgbw))) (set-chan8 4 (percent->dmxval8 (cadr rgbw))) -- cgit v1.2.3