Handbook
Glossary
hex>rgba ( hex -- rgba )
Vocabulary
colors
.
private
Inputs
hex
an
object
Outputs
rgba
an
object
Definition
USING:
colors
combinators
grouping
kernel
math
math.parser
sequences
;
IN:
colors.private
:
hex>rgba
( hex -- rgba )
dup
length
{
{
6
[
2
group
[
hex>
255
/f
]
map
first3
1.0
]
}
{
8
[
2
group
[
hex>
255
/f
]
map
first4
]
}
{
3
[
[
digit>
15
/f
]
{
}
map-as
first3
1.0
]
}
{
4
[
[
digit>
15
/f
]
{
}
map-as
first4
]
}
[
drop
invalid-hex-color
]
}
case
<rgba>
;