## yiq2rgb (`lygia`/`color`/`space`/`yiq2rgb`)

Convert a color in YIQ to linear RGB color. From https://en.wikipedia.org/wiki/YIQ

Use:

``````<vec3|vec4> yiq2rgb(<vec3|vec4> color)
``````

Check it on Github

``````
#ifndef MAT_YIQ2RGB
#define MAT_YIQ2RGB
const mat3 YIQ2RGB = mat3(  1.0,  0.9469,  0.6235,
1.0, -0.2747, -0.6357,
1.0, -1.1085,  1.7020 );
#endif

#ifndef FNC_YIQ2RGB
#define FNC_YIQ2RGB
vec3 yiq2rgb(const in vec3 yiq) { return YIQ2RGB * yiq; }
vec4 yiq2rgb(const in vec4 yiq) { return vec4(yiq2rgb(yiq.rgb), yiq.a); }
#endif

``````

Use:

``````<float3|float4> yiq2rgb(<float3|float4> color)
``````

Check it on Github

``````
#ifndef MAT_YIQ2RGB
#define MAT_YIQ2RGB
const float3x3 YIQ2RGB = float3x3(  1.0,  0.9469,  0.6235,
1.0, -0.2747, -0.6357,
1.0, -1.1085,  1.7020 );
#endif

#ifndef FNC_YIQ2RGB
#define FNC_YIQ2RGB
float3 yiq2rgb(in float3 yiq) { return mul(yiq2rgb_mat, yiq); }
float4 yiq2rgb(in float4 yiq) { return float4(yiq2rgb(yiq.rgb), yiq.a); }
#endif

``````

Check it on Github

``````const YIQ2RGB : mat3x3<f32>  = mat3x3<f32>(
vec3f(1.0,  0.9469,  0.6235),
vec3f(1.0, -0.2747, -0.6357),
vec3f(1.0, -1.1085,  1.7020) );
fn yiq2rgb(yiq : vec3f) -> vec3f { return YIQ2RGB * yiq; }
``````