Handbook
Glossary
ryb>rgb ( r! y! b! -- r g b )
Vocabulary
colors
.
ryb
.
private
Inputs
r!
an
object
y!
an
object
b!
an
object
Outputs
r
an
object
g
an
object
b
an
object
Definition
USING:
kernel
math
math.order
;
IN:
colors.ryb.private
::
ryb>rgb
( r! y! b! -- r g b )
r y b
max
max
:>
my y b
min
:>
g! y g
-
y! b g
-
b! b g
[
0
>
]
both?
[
b 2
*
b! g 2
*
g!
]
when
r y
+
r! g y
+
g! r g b
3dup
max
max
[
my
swap
/
[
*
]
curry
tri@
]
unless-zero
;