Color Handling Superclass

Description

The colorlib class provides a series of methods methods which allow to convert colors between different color spaces and is not intended to be used by end-users (not exported).

Users should use the dedicated classes for the available color spaces which all extend this class. These are CIELAB, CIELUV, CIEXYZ, HLS, HSV, RGB, hexcols, polarLAB, polarLUV, and sRGB.

Usage

colorlib()

Methods

colorlib.HLS_to_RGB(h, l, s)
Convert HLS to RGB
colorlib.HLS_to_sRGB(h, l, s)
Convert HLC to Standard RGB (sRGB)
colorlib.HSV_to_RGB(h, s, v)
Convert HSV to RGB
colorlib.HSV_to_sRGB(h, s, v)
Convert HSV to Standard RGB (sRGB)
colorlib.LAB_to_XYZ(L, A, B, XN=None, YN=None, ZN=None)
Convert CIELAB to CIEXYZ
colorlib.LAB_to_polarLAB(L, A, B)
Convert CIELAB to the polar representation (polarLAB)
colorlib.LUV_to_XYZ(L, U, V, XN=None, YN=None, ZN=None)
Convert CIELUV to CIELAB
colorlib.LUV_to_polarLUV(L, U, V)
Convert CIELUV to the polar representation (polarLUV; HCL)
colorlib.RGB_to_HLS(r, g, b)
Convert RGB to HLS
colorlib.RGB_to_HSV(r, g, b)
Convert RGB to HSV
colorlib.RGB_to_XYZ(R, G, B, XN=None, YN=None, ZN=None)
Convert RGB to CIEXYZ
colorlib.RGB_to_sRGB(R, G, B, gamma=2.4)
Convert RGB to Standard RGB
colorlib.XYZ_to_LAB(X, Y, Z, XN=None, YN=None, ZN=None)
Convert CIEXYZ to CIELAB
colorlib.XYZ_to_LUV(X, Y, Z, XN=None, YN=None, ZN=None)
Convert CIEXYZ to CIELUV.
colorlib.XYZ_to_RGB(X, Y, Z, XN=None, YN=None, ZN=None)
Convert CIEXYZ to RGB
colorlib.XYZ_to_uv(X, Y, Z)
Convert CIEXYZ to u and v
colorlib.ftrans(u, gamma)
Gamma Correction
colorlib.gtrans(u, gamma)
Gamma Correction
colorlib.hex_to_sRGB(hex_, gamma=2.4)
Convert Hex Colors to Standard RGB (sRGB)
colorlib.polarLAB_to_LAB(L, C, H)
Convert polarLAB to CIELAB
colorlib.polarLUV_to_LUV(L, C, H)
Convert Polar CIELUV (HCL) to CIELUV
colorlib.sRGB_to_HLS(r, g, b)
Convert Standard RGB (sRGB) to HLS
colorlib.sRGB_to_HSV(r, g, b)
Convert RGB to HSV
colorlib.sRGB_to_RGB(R, G, B, gamma=2.4)
Convert Standard RGB to RGB
colorlib.sRGB_to_hex(r, g, b, fixup=True)
Convert Standard RGB (sRGB) to Hex Colors