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