PyNGL Home > Functions > Color routines

Ngl.yiqrgb

Converts from the YIQ color space to RGB.

Prototype

red, green, blue = Ngl.yiqrgb(Y, I, Q)

Arguments

Y

Y component (luminance) values in the range [0.,1.].

I

I component (chrominance orange-blue) values in the range [-0.6, 0.6].

Q

Q component (chrominance purple-green) values in the range [-0.52, 0.52].

Return values

red, green, blue

The red, green, and blue intensity values in the range [0., 1.].

Description

This function converts from the YIQ (TV standard) color space to the RGB (Red, Green, Blue) color space. The input arguments must all be scalars or all NumPy arrays, lists, or tuples of any shape. The returned values will be either scalars, or NumPy arrays of the same shape as the input arguments.

The conversion equations are:

      R = Y +  .956*I +  .621*Q
      G = Y -  .272*I -  .647*Q
      B = Y - 1.105*I + 1.702*Q

See Also

Ngl.hlsrgb, Ngl.hsvrgb, Ngl.rgbhls, Ngl.rgbhsv, Ngl.rgbyiq

Examples

For an example, see the test in color3.py.