>rgba ( color -- rgba )
Colors

Prev:<rgba> ( red green blue alpha -- rgba )
Next:>rgba-components ( object -- r g b a )


Vocabulary
colors

Inputs
colora color


Outputs
rgbaa rgba


Generic word contract
Converts a color to an RGBA color.

Definition

GENERIC: >rgba ( color -- rgba )


Methods








































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> ;



M: yiqa >rgba
{ [ y>> ] [ in-phase>> ] [ quadrature>> ] [ alpha>> ] }
cleave [
[
[ 0.9468822170900693 * ] [ 0.6235565819861433 * ]
bi* + +
] [
[ 0.27478764629897834 * ] [ 0.6356910791873801 * ]
bi* + -
] [
[ 1.1085450346420322 * ] [ 1.7090069284064666 * ]
bi* - -
] 3tri [ 0.0 1.0 clamp ] tri@
] dip <rgba> ; inline