summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sly/render/color.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/sly/render/color.scm b/sly/render/color.scm
index 6497339..80c7740 100644
--- a/sly/render/color.scm
+++ b/sly/render/color.scm
@@ -31,7 +31,7 @@
make-color
color?
color-r color-g color-b color-a
- rgba rgb
+ rgba rgb transparency
color* color+ color- color-inverse color-lerp
white black red green blue yellow magenta cyan transparent
tango-light-butter tango-butter tango-dark-butter
@@ -86,6 +86,11 @@ For example: #xffffff will return a color with RGBA values 1, 1, 1,
(color-component color-code 0)
1))
+(define (transparency alpha)
+ "Create a new color that is white with a transparency value of
+ALPHA. ALPHA is clamped to the range [0, 1]."
+ (make-color 1 1 1 alpha))
+
(define color*
(match-lambda*
((($ <color> r1 g1 b1 a1) ($ <color> r2 g2 b2 a2))