Handbook
Glossary
>xyza ( color -- xyza )
CIE 1931 XYZ colors
Prev:
<xyza> ( x y z alpha -- xyza )
Vocabulary
colors
.
xyz
Inputs
color
an
object
Outputs
xyza
an
object
Definition
IN:
colors.xyz
GENERIC:
>xyza
( color -- xyza )
Methods
USING:
colors.lch
colors.luv
colors.xyz
;
M:
LCHuv
>xyza
>luva
>xyza
;
USING:
accessors
colors.lab
colors.xyz
colors.xyz.private
kernel
locals.backend
math
math.functions
;
M:
laba
>xyza
[
[
l>>
]
[
a>>
]
[
b>>
]
tri
3
load-locals
-2
get-local
16
+
116
/
load-local
-2
get-local
500
/
0
get-local
+
load-local
-1
get-local
-2
get-local
200
/
-
load-local
-1
get-local
3
^
load-local
-1
get-local
3
^
load-local
-1
get-local
xyz_epsilon
>
-1
get-local
[
load-local
0
get-local
1
drop-locals
]
curry
-3
get-local
[
load-local
116 0
get-local
*
16
-
xyz_kappa
/
1
drop-locals
]
curry
if
load-local
-8
get-local
xyz_kappa
xyz_epsilon
*
>
-8
get-local
[
load-local
0
get-local
16
+
116
/
3
^
1
drop-locals
]
curry
-8
get-local
[
load-local
0
get-local
xyz_kappa
/
1
drop-locals
]
curry
if
load-local
-2
get-local
xyz_epsilon
>
-2
get-local
[
load-local
0
get-local
1
drop-locals
]
curry
-4
get-local
[
load-local
116 0
get-local
*
16
-
xyz_kappa
/
1
drop-locals
]
curry
if
load-local
-2
get-local
wp_x
*
-1
get-local
wp_y
*
0
get-local
wp_z
*
11
drop-locals
]
[
alpha>>
]
bi
<xyza>
;
USING:
accessors
colors.luv
colors.luv.private
colors.xyz
colors.xyz.private
kernel
locals.backend
math
math.functions
;
M:
luva
>xyza
[
wp_x
wp_y
wp_z
xyz-to-uv
2
load-locals
[
l>>
]
[
u>>
]
[
v>>
]
tri
3
load-locals
52 -2
get-local
*
13 -2
get-local
*
-4
get-local
*
-1
get-local
+
/
1
-
3
/
load-local
-3
get-local
xyz_kappa
xyz_epsilon
*
>
-3
get-local
[
load-local
0
get-local
16
+
116
/
3
^
wp_y
*
1
drop-locals
]
curry
-3
get-local
[
load-local
0
get-local
xyz_kappa
/
wp_y
*
1
drop-locals
]
curry
if
load-local
0
get-local
-5
*
load-local
39 -5
get-local
*
13 -5
get-local
*
-6
get-local
*
-3
get-local
+
/
5
-
-1
get-local
*
load-local
0
get-local
-1
get-local
-
-3
get-local
1/3
+
/
load-local
-4
get-local
0
get-local
*
-2
get-local
+
load-local
-1
get-local
-4
get-local
0 ~3 more~
]
[
alpha>>
]
bi
<xyza>
;
USING:
colors
colors.xyz
kernel
;
M:
object
>xyza
>rgba
>xyza
;
USING:
accessors
colors
colors.xyz
colors.xyz.private
kernel
locals.backend
math
;
M:
rgba
>xyza
[
[
red>>
]
[
green>>
]
[
blue>>
]
tri
[
invert-rgb-compand
]
tri@
3
load-locals
-2
get-local
0.4124564
*
-1
get-local
0.3575761
*
0
get-local
0.1804375
*
+
+
-2
get-local
0.2126729
*
-1
get-local
0.7151522
*
0
get-local
0.072175
*
+
+
-2
get-local
0.0193339
*
-1
get-local
0.119192
*
0
get-local
0.9503041
*
+
+
3
drop-locals
]
[
alpha>>
]
bi
<xyza>
;
USING:
accessors
colors.xyy
colors.xyz
kernel
locals.backend
math
;
M:
xyYa
>xyza
[
[
x>>
]
[
y>>
]
[
Y>>
]
tri
3
load-locals
-2
get-local
-1
get-local
/
0
get-local
*
0
get-local
1 -2
get-local
-
-1
get-local
-
-1
get-local
/
0
get-local
*
3
drop-locals
]
[
alpha>>
]
bi
<xyza>
;
USING:
colors.xyz
;
M:
xyza
>xyza
;
inline