Handbook
Glossary
>hsva ( color -- hsva )
Vocabulary
colors
.
hsv
Inputs
color
an
object
Outputs
hsva
an
object
Definition
IN:
colors.hsv
GENERIC:
>hsva
( color -- hsva )
Methods
USING:
colors.hsv
;
M:
hsva
>hsva
;
inline
USING:
colors
colors.hsv
kernel
;
M:
object
>hsva
>rgba
>hsva
;
USING:
colors
colors.hsv
colors.hsv.private
combinators
kernel
math
;
M::
rgba
>hsva
( rgba -- hsva )
rgba
>rgba-components
:>
( r g b a ) r g b
sort-triple
:>
( z y x ) x z
=
x
zero?
or
[
0 0 x a
<hsva>
]
[
{
{
[
r x
=
g z
=
and
]
[
5 x b
-
x z
-
/
+
]
}
{
[
r x
=
g z
>
and
]
[
1 x g
-
x z
-
/
-
]
}
{
[
g x
=
b z
=
and
]
[
1 x r
-
x z
-
/
+
]
}
{
[
g x
=
b z
>
and
]
[
3 x b
-
x z
-
/
-
]
}
{
[
b x
=
r z
=
and
]
[
3 x g
-
x z
-
/
+
]
}
{
[
b x
=
r z
>
and
]
[
5 x r
-
x z
-
/
-
]
}
}
cond
6
/
360
*
x z
-
x
/
x a
<hsva>
]
if
;