grapa.shared.colors_conversion
Provides conversions between different color spaces. RGB, and CIE Lab and CIE LCh. Meant as an extension to python colorsys Includes reparametrized versions of CIE Lab and LCh, with values 0-1.
@author: Romain Carron Copyright (c) 2026, Empa, Laboratory for Thin Films and Photovoltaics, Romain Carron
Functions
|
Convert CIELAB to CIELCh°. |
|
Convert CIELAB to sRGB (D65). |
|
Convert CIELAB to CIELCh°, all values between 0-1 :param L: lightness (0-1) :param a: Lab chromaticity component b, normalized :param b: Lab chromaticity component b, normalized :return: (L, C, h) where C = chroma /150 and h = hue angle 0-1 |
|
Convert CIELAB to sRGB (D65). |
|
Convert CIELCh° to CIELAB. |
|
Converts CIE LCh into rgb (L, C, h) where C = chroma, h = hue angle in degrees (0-360) :return: (r,g,b) as floats 0-1 |
|
Convert CIELCh° to CIELAB. |
|
(r,g,b) as floats 0-1 |
|
Convert an sRGB color to CIELAB (D65). |
|
Convert an sRGB color to CIELAB (D65). |
|
(r,g,b) as floats 0-1 :return: (L, C, h) where C = chroma, h = hue angle in degrees (0-360) |
|
(r,g,b) as floats 0-1 |
Classes
Provides conversion functions for CIE LCh colorspace, with parameter values normalized 0-1. |
|
Provides conversion functions for CIE Lab colorspace. |