colour.RGB_luminance

colour.RGB_luminance(RGB, primaries, whitepoint)[source]

Returns the luminance \(Y\) of given RGB components from given primaries and whitepoint.

Parameters
  • RGB (array_like) – RGB chromaticity coordinate matrix.

  • primaries (array_like, (3, 2)) – Primaries chromaticity coordinate matrix.

  • whitepoint (array_like) – Illuminant / whitepoint chromaticity coordinates.

Returns

Luminance \(Y\).

Return type

numeric or ndarray

Examples

>>> RGB = np.array([0.21959402, 0.06986677, 0.04703877])
>>> p = np.array([0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700])
>>> whitepoint = np.array([0.32168, 0.33767])
>>> RGB_luminance(RGB, p, whitepoint)  
0.1230145...