colors.xyz: some refactoring.

db4
John Benediktsson 2014-06-22 07:04:09 -07:00
parent 858c5db19d
commit 0f74b77b27
6 changed files with 17 additions and 17 deletions

View File

@ -1,8 +1,8 @@
! 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
@ -12,18 +12,11 @@ C: <luva> luva
<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 ;

View File

@ -1 +1 @@
CIE xyY colors
CIE 1931 xyY colors

View File

@ -2,10 +2,10 @@ USING: help.markup help.syntax ;
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>

View File

@ -1 +1 @@
CIE XYZ colors
CIE 1931 XYZ colors

View File

@ -2,10 +2,10 @@ USING: help.markup help.syntax ;
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>

View File

@ -12,6 +12,13 @@ C: <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 ;