psychopy.tools.colorspacetools.cielch2rgb

psychopy.tools.colorspacetools.cielch2rgb(lch, whiteXYZ=None, conversionMatrix=None, transferFunc=None, clip=False, **kwargs)[source]

Transform CIE L*C*h* coordinates to RGB tristimulus values.

Parameters:
  • lch (tuple, list or ndarray) – 1-, 2-, 3-D vector of CIE L*C*h* coordinates to convert. The last dimension should be length-3 in all cases specifying a single coordinate. The hue angle *h is expected in degrees.

  • whiteXYZ (tuple, list or ndarray) – 1-D vector coordinate of the white point in CIE-XYZ color space. Must be the same white point needed by the conversion matrix. The default white point is D65 if None is specified, defined as X, Y, Z = 0.9505, 1.0000, 1.0890

  • conversionMatrix (tuple, list or ndarray) – 3x3 conversion matrix to transform CIE-XYZ to RGB values. The default matrix is sRGB with a D65 white point if None is specified. Note that values must be gamma corrected to appear correctly according to the sRGB standard.

  • transferFunc (pyfunc or None) – Signature of the transfer function to use. If None, values are kept as linear RGB (it’s assumed your display is gamma corrected via the hardware CLUT). The TF must be appropriate for the conversion matrix supplied. Additional arguments to ‘transferFunc’ can be passed by specifying them as keyword arguments. Gamma functions that come with PsychoPy are ‘srgbTF’ and ‘rec709TF’, see their docs for more information.

  • clip (boolean) – Make all output values representable by the display. However, colors outside of the display’s gamut may not be valid!

Returns:

array of RGB tristimulus values

Return type:

ndarray


Back to top