colors.xyz: some refactoring.
parent
858c5db19d
commit
0f74b77b27
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2014 John Benediktsson
|
! Copyright (C) 2014 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license
|
! See http://factorcode.org/license.txt for BSD license
|
||||||
|
|
||||||
USING: accessors colors colors.xyz kernel locals math
|
USING: accessors colors colors.xyz colors.xyz.private kernel
|
||||||
math.functions ;
|
locals math math.functions ;
|
||||||
|
|
||||||
IN: colors.luv
|
IN: colors.luv
|
||||||
|
|
||||||
|
@ -12,18 +12,11 @@ C: <luva> luva
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
CONSTANT: xyz_epsilon 216/24389
|
|
||||||
CONSTANT: xyz_kappa 24389/27
|
|
||||||
|
|
||||||
:: xyz-to-uv ( x y z -- u v )
|
:: xyz-to-uv ( x y z -- u v )
|
||||||
x y 15 * z 3 * + + :> d
|
x y 15 * z 3 * + + :> d
|
||||||
4 x * d /
|
4 x * d /
|
||||||
9 y * d / ; foldable
|
9 y * d / ; foldable
|
||||||
|
|
||||||
CONSTANT: wp_x 0.95047
|
|
||||||
CONSTANT: wp_y 1.00000
|
|
||||||
CONSTANT: wp_z 1.08883
|
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
M: luva >rgba >xyza >rgba ;
|
M: luva >rgba >xyza >rgba ;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
CIE xyY colors
|
CIE 1931 xyY colors
|
||||||
|
|
|
@ -2,10 +2,10 @@ USING: help.markup help.syntax ;
|
||||||
IN: colors.xyy
|
IN: colors.xyy
|
||||||
|
|
||||||
HELP: xyYa
|
HELP: xyYa
|
||||||
{ $class-description "The class of CIE xyY colors with an alpha channel." } ;
|
{ $class-description "The class of CIE 1931 xyY colors with an alpha channel." } ;
|
||||||
|
|
||||||
ARTICLE: "colors.xyy" "CIE xyY colors"
|
ARTICLE: "colors.xyy" "CIE 1931 xyY colors"
|
||||||
"The " { $vocab-link "colors.xyy" } " vocabulary implements CIE xyY colors, together with an alpha channel."
|
"The " { $vocab-link "colors.xyy" } " vocabulary implements CIE 1931 xyY colors, together with an alpha channel."
|
||||||
{ $subsections
|
{ $subsections
|
||||||
xyYa
|
xyYa
|
||||||
<xyYa>
|
<xyYa>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
CIE XYZ colors
|
CIE 1931 XYZ colors
|
||||||
|
|
|
@ -2,10 +2,10 @@ USING: help.markup help.syntax ;
|
||||||
IN: colors.xyz
|
IN: colors.xyz
|
||||||
|
|
||||||
HELP: xyza
|
HELP: xyza
|
||||||
{ $class-description "The class of CIE XYZ colors with an alpha channel." } ;
|
{ $class-description "The class of CIE 1931 XYZ colors with an alpha channel." } ;
|
||||||
|
|
||||||
ARTICLE: "colors.xyz" "CIE XYZ colors"
|
ARTICLE: "colors.xyz" "CIE 1931 XYZ colors"
|
||||||
"The " { $vocab-link "colors.xyz" } " vocabulary implements CIE XYZ colors, together with an alpha channel."
|
"The " { $vocab-link "colors.xyz" } " vocabulary implements CIE 1931 XYZ colors, together with an alpha channel."
|
||||||
{ $subsections
|
{ $subsections
|
||||||
xyza
|
xyza
|
||||||
<xyza>
|
<xyza>
|
||||||
|
|
|
@ -12,6 +12,13 @@ C: <xyza> xyza
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
|
CONSTANT: xyz_epsilon 216/24389
|
||||||
|
CONSTANT: xyz_kappa 24389/27
|
||||||
|
|
||||||
|
CONSTANT: wp_x 0.95047
|
||||||
|
CONSTANT: wp_y 1.00000
|
||||||
|
CONSTANT: wp_z 1.08883
|
||||||
|
|
||||||
: srgb-compand ( v -- v' )
|
: srgb-compand ( v -- v' )
|
||||||
dup 0.0031308 <= [ 12.92 * ] [ 2.4 recip ^ 1.055 * 0.055 - ] if ;
|
dup 0.0031308 <= [ 12.92 * ] [ 2.4 recip ^ 1.055 * 0.055 - ] if ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue