Color representations¶
thcolor allows you to represent colors in different colorspaces and using different kind of coordinates. This page regroups the information about these representations.
Note that all color representations have an alpha
component.
sRGB colors¶
sRGB colors are colors represented using the red, green and blue channel intensities in the standard RGB color space.
In thcolor, such a color is represented by the
thcolor.colors.SRGBColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.assrgb()
(“as sRGB”) method.
CMYK colors¶
CMYK colors are colors represented using the cyan, magenta, yellow and black values in the CMYK color model.
In thcolor, such a color is represented by the
thcolor.colors.CMYKColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.ascmyk()
method.
HSL colors¶
HSL colors are colors represented using the hue, saturation and lightness as polar coordinates in the sRGB color space. See HSL and HSV for more information.
In thcolor, such a color is represented by the
thcolor.colors.HSLColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.ashsl()
method.
HSV colors¶
HSV colors are colors represented using the hue, saturation and value as polar coordinates in the sRGB color space. See HSL and HSV for more information.
In thcolor, such a color is represented by the
thcolor.colors.HSVColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.ashsv()
method.
HWB colors¶
HWB colors are colors represented using the hue, whiteness and blackness in the HWB color model.
In thcolor, such a color is represented by the
thcolor.colors.HWBColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.ashwb()
method.
LAB colors¶
LAB colors are colors represented using the lightness and A and B coordinates in the CIELAB color space.
In thcolor, such a color is represented by the
thcolor.colors.LABColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.aslab()
method.
LCH colors¶
LCH colors are colors represented using the lightness, chroma and hue in the CIELAB color space.
In thcolor, such a color is represented by the
thcolor.colors.LCHColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.aslch()
method.
XYZ colors¶
XYZ colors are colors represented using its x, y and z coordinates in the CIE 1931 XYZ color space.
In thcolor, such a color is represented by the
thcolor.colors.XYZColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.asxyz()
method.
YIQ colors¶
YIQ colors are colors represented using its coordinates in the YIQ color space.
In thcolor, such a color is represented by the
thcolor.colors.YIQColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.asyiq()
method.
YUV colors¶
YUV colors are colors represented using its coordinates in the YUV color space.
In thcolor, such a color is represented by the
thcolor.colors.YUVColor
class, and other representations can be
converted to this one using the thcolor.colors.Color.asyuv()
method.
Natural colors¶
Natural colors (NCol) are an initiative from W3Schools to make a color that is easily identifiable from reading its definition.
In thcolor, no dedicated class exists for this representation since it is
a light derivative from HWB colors with the angle
expressed using a given format. It is, however, optionally supported
in expressions behind the __ncol_support__
option.