colors.hsv: add a golden-rainbox color sequence word.
parent
8c8d8d0c14
commit
482ea99628
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Eduardo Cavazos.
|
! Copyright (C) 2008 Eduardo Cavazos.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays colors combinators kernel locals math
|
USING: accessors arrays colors combinators kernel locals math
|
||||||
math.functions sequences sorting ;
|
math.functions random sequences sorting ;
|
||||||
IN: colors.hsv
|
IN: colors.hsv
|
||||||
|
|
||||||
! h [0,360)
|
! h [0,360)
|
||||||
|
@ -71,3 +71,8 @@ PRIVATE>
|
||||||
[ value>> ]
|
[ value>> ]
|
||||||
[ alpha>> ]
|
[ alpha>> ]
|
||||||
} cleave <hsva> ;
|
} cleave <hsva> ;
|
||||||
|
|
||||||
|
: golden-rainbow ( num-colors saturation luminance -- colors )
|
||||||
|
[ random-unit ] 3dip '[
|
||||||
|
0.618033988749895 + 1.0 mod dup _ _ 1.0 <hsva>
|
||||||
|
] replicate nip ;
|
||||||
|
|
Loading…
Reference in New Issue