summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-04-12 20:35:30 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-04-12 20:35:30 +0200
commit1531116036d1b5e0d2482ff2c8d77ad21f1d2bef (patch)
treeabf5ca5cef4c7f8550a0194ef6b2383945648ced
parenta3b3403a83dcaab9362186a8eac130c0c7e61ab7 (diff)
Add random-color.
-rw-r--r--pict.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/pict.scm b/pict.scm
index dfa854a..a9ec612 100644
--- a/pict.scm
+++ b/pict.scm
@@ -96,6 +96,7 @@
;; colors
rgb
+ random-color
colors))
@@ -869,6 +870,9 @@ DX and DY."
(error "Color component values must be between 0 and 255."))
(format #f "rgb(~a,~a,~a)" r g b))
+(define (random-color)
+ (rgb (random 256) (random 256) (random 256)))
+
;; List of defined SVG color names
(define colors
(list "aliceblue" "antiquewhite" "aqua" "aquamarine" "azure" "beige"