Handbook
Glossary
xyza
CIE 1931 XYZ colors
Next:
<xyza> ( x y z alpha -- xyza )
Vocabulary
colors
.
xyz
Class description
The class of CIE 1931 XYZ colors with an alpha channel.
Definition
IN:
colors.xyz
TUPLE:
xyza
x y z alpha
;
Methods
USING:
accessors
colors.lab
colors.xyz
colors.xyz.private
kernel
locals.backend
math
math.functions
;
M:
xyza
>laba
[
[
x>>
wp_x
/
]
[
y>>
wp_y
/
]
[
z>>
wp_z
/
]
tri
[
dup
xyz_epsilon
>
[
1/3
^
]
[
xyz_kappa
*
16
+
116
/
]
if
]
tri@
3
load-locals
116 -1
get-local
*
16
-
500 -2
get-local
-1
get-local
-
*
200 -1
get-local
0
get-local
-
*
3
drop-locals
]
[
alpha>>
]
bi
<laba>
;
USING:
accessors
colors.luv
colors.luv.private
colors.xyz
colors.xyz.private
kernel
locals.backend
math
math.functions
;
M:
xyza
>luva
[
wp_x
wp_y
wp_z
xyz-to-uv
2
load-locals
[
x>>
]
[
y>>
]
[
z>>
]
tri
3
load-locals
-2
get-local
-1
get-local
0
get-local
xyz-to-uv
2
load-locals
-3
get-local
wp_y
/
load-local
0
get-local
xyz_epsilon
>
0
get-local
[
load-local
0
get-local
1/3
^
116
*
16
-
1
drop-locals
]
curry
0
get-local
[
load-local
xyz_kappa
0
get-local
*
1
drop-locals
]
curry
if
load-local
13 0
get-local
*
-3
get-local
-8
get-local
-
*
load-local
13 -1
get-local
*
-3
get-local
-8
get-local
-
*
load-local
-2
get-local
-1
get-local
0
get-local
11
drop-locals
]
[
alpha>>
]
bi
<luva>
;
USING:
accessors
colors
colors.xyz
colors.xyz.private
kernel
locals.backend
math
math.order
;
M:
xyza
>rgba
[
[
x>>
]
[
y>>
]
[
z>>
]
tri
3
load-locals
-2
get-local
3.2404542
*
-1
get-local
-1.5371385
*
0
get-local
-0.4985314
*
+
+
-2
get-local
-0.969266
*
-1
get-local
1.8760108
*
0
get-local
0.041556
*
+
+
-2
get-local
0.0556434
*
-1
get-local
-0.2040259
*
0
get-local
1.0572252
*
+
+
[
srgb-compand
0.0 1.0
clamp
]
tri@
3
drop-locals
]
[
alpha>>
]
bi
<rgba>
;
USING:
accessors
colors.xyy
colors.xyz
kernel
locals.backend
math
;
M:
xyza
>xyYa
[
[
x>>
]
[
y>>
]
[
z>>
]
tri
3
load-locals
-2
get-local
-1
get-local
0
get-local
+
+
-2
get-local
[
load-local
0
get-local
swap
/
1
drop-locals
]
curry
-1
get-local
[
load-local
0
get-local
swap
/
1
drop-locals
]
curry
bi
-1
get-local
3
drop-locals
]
[
alpha>>
]
bi
<xyYa>
;
USING:
colors.xyz
;
M:
xyza
>xyza
;
inline