colors: Inline >rgba methods.

Doug Coleman 2013-02-19 10:09:29 -08:00
parent bebe8a0306
commit 04a062f7a3
6 changed files with 6 additions and 6 deletions

View File

@ -16,7 +16,7 @@ C: <rgba> rgba
GENERIC: >rgba ( color -- rgba )
M: rgba >rgba ( rgba -- rgba ) ;
M: rgba >rgba ( rgba -- rgba ) ; inline
M: color red>> ( color -- red ) >rgba red>> ;
M: color green>> ( color -- green ) >rgba green>> ;

View File

@ -8,7 +8,7 @@ TUPLE: gray < color { gray read-only } { alpha read-only } ;
C: <gray> gray
M: gray >rgba ( gray -- rgba )
[ gray>> dup dup ] [ alpha>> ] bi <rgba> ;
[ gray>> dup dup ] [ alpha>> ] bi <rgba> ; inline
M: gray red>> gray>> ;

View File

@ -40,7 +40,7 @@ M: hsva >rgba ( hsva -- rgba )
{ 4 [ [ t ] [ p ] [ value>> ] tri ] }
{ 5 [ [ value>> ] [ p ] [ q ] tri ] }
} case
] [ alpha>> ] bi <rgba> ;
] [ alpha>> ] bi <rgba> ; inline
:: rgba>hsva ( rgba -- hsva )
rgba >rgba-components :> ( r g b a )

View File

@ -19,7 +19,7 @@ M: cmyka >rgba
[ [ cyan>> ] [ black>> ] bi + ]
[ [ magenta>> ] [ black>> ] bi + ]
[ [ yellow>> ] [ black>> ] bi + ] tri
[ 1.0 min 1.0 swap - ] tri@ 1.0 <rgba> ;
[ 1.0 min 1.0 swap - ] tri@ 1.0 <rgba> ; inline
: rgba>cmyka ( rgba -- cmyka )
>rgba-components [

View File

@ -41,7 +41,7 @@ M: hsla >rgba
p q h value
p q h 1/3 - value
] if
] dip <rgba> ;
] dip <rgba> ; inline
: rgba>hsla ( rgba -- hsla )
>rgba-components [| r g b |

View File

@ -21,7 +21,7 @@ M: yiqa >rgba
[ [ 0.276066 * ] [ 0.639810 * ] bi* + - ]
[ [ 1.105450 * ] [ 1.729860 * ] bi* - - ]
3tri [ 0.0 1.0 clamp ] tri@
] dip <rgba> ;
] dip <rgba> ; inline
: rgba>yiqa ( rgba -- yiqa )
>rgba-components [