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.2747876462989783 * ] [ 0.6356910791873801 * ]
bi* + -
] [
[ 1.108545034642032 * ] [ 1.709006928406467 * ] bi*
- -
] 3tri [ 0.0 1.0 clamp ] tri@
] dip <rgba> ; inline