! Copyright (C) 2014 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
-USING: accessors colors colors.xyz kernel locals math
-math.functions ;
+USING: accessors colors colors.xyz colors.xyz.private kernel
+locals math math.functions ;
IN: colors.luv
<PRIVATE
-CONSTANT: xyz_epsilon 216/24389
-CONSTANT: xyz_kappa 24389/27
-
:: xyz-to-uv ( x y z -- u v )
x y 15 * z 3 * + + :> d
4 x * d /
9 y * d / ; foldable
-CONSTANT: wp_x 0.95047
-CONSTANT: wp_y 1.00000
-CONSTANT: wp_z 1.08883
-
PRIVATE>
M: luva >rgba >xyza >rgba ;
-CIE xyY colors
+CIE 1931 xyY colors
IN: colors.xyy
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"
-"The " { $vocab-link "colors.xyy" } " vocabulary implements CIE xyY colors, together with an alpha channel."
+ARTICLE: "colors.xyy" "CIE 1931 xyY colors"
+"The " { $vocab-link "colors.xyy" } " vocabulary implements CIE 1931 xyY colors, together with an alpha channel."
{ $subsections
xyYa
<xyYa>
-CIE XYZ colors
+CIE 1931 XYZ colors
IN: colors.xyz
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"
-"The " { $vocab-link "colors.xyz" } " vocabulary implements CIE XYZ colors, together with an alpha channel."
+ARTICLE: "colors.xyz" "CIE 1931 XYZ colors"
+"The " { $vocab-link "colors.xyz" } " vocabulary implements CIE 1931 XYZ colors, together with an alpha channel."
{ $subsections
xyza
<xyza>
<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' )
dup 0.0031308 <= [ 12.92 * ] [ 2.4 recip ^ 1.055 * 0.055 - ] if ;