.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Graphics::Toolkit::Color::Manual::Space 3" .TH Graphics::Toolkit::Color::Manual::Space 3 2026-06-21 "perl v5.42.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Graphics::Toolkit::Color::Manual::Space \- details about supported color spaces .SH SYNOPSIS .IX Header "SYNOPSIS" GTC supports 33 color spaces. This manual page lists them all and displays their name, alias name, family name, axis names (long, short and role) and all other properties that might help GTC users, like \fIshape\fR, \fIgamma\fR, \&\fIwhite point\fR and so on. These terms are explained here. Some sections about a specific color space are enriched by useful background information and historical context. See a condensed overview of the color spaces, sorted by family at the CheatSheet. .SH INTRODUCTION .IX Header "INTRODUCTION" Color spaces are mathematical\-geometrical constructs that associate each color with a point inside a coordinate system. The numerical values of a color definition are viewed as coordinates associated with the axes that express different properties. The closer two colors are along an axis the more similar they are in that property. That is also why the ordering of the values does matter. Axes have a canonical order which in most cases is reflected in the space name. The values have to be in that same order. For the majority of spaces, axes have a long name, often an English word, and a short name that is one letter. More often than not the first character of the long name is the short name. .PP All color spaces are finite and only certain value ranges along an axis are acceptable. In other words: there is a mandatory minimum and maximum value for each axis. A \fInormal\fR axis simply has an associated minimum value of zero and maximum of one. Color definitions that do not obey this restriction are out of \&\fIgamut\fR (is_in_gamut). And while there might be sometimes subtle differences between value range and gamut, these are no subject of consideration here. .PP Almost all spaces have 3 dimensions (axes), only \fICMYK\fR has four. And most spaces are completely linear like in Euclidean (everyday) geometry, but some spaces are cylindrical. That means only two axes are straight lines and one is angular (circle shaped), because the associated value describes an angle. Some spaces have additional constraints about their shape. For instance "HSV" has the shape of a cone and not of a cylinder and also "HWB" is not a cylinder since the sum of \fIwhiteness\fR and \fIblackness\fR should never exceed 100%. .PP While the author acknowledges that some of the spaces below should be called systems to be technically correct, they still will be called spaces here, because one goal of this software is a seamless interoperability between them. .SH FAMILY .IX Header "FAMILY" Another approach to heighten the interoperability is to group them into families of similar spaces. Every family has a representative color space, which lends its name as family name. The other members of the family need to provide a way to map their axes to the axes of the representative. This is achieved either by having the same long axis names (like \fIHSL\fR and \fIOKHSL\fR) or by assigning a role name to each axis. For instance the \fIchroma\fR axis of the \fILCH\fR space has the role name \fIsaturation\fR so GTC can treat the \fIchroma\fR the same way as an \fIHSL\fR \fIsaturation\fR value. The spaces on this page are grouped by family (for better orientation), but not every color space belongs to a family, hence the chapter "Other". .SH ORDER .IX Header "ORDER" Please note the ordering of spaces within each family. That corresponds to the internal search order. That means if you define a color with values in hash format, a HASH reference with values under the keys of \fIred\fR, \fIgreen\fR and \fIblue\fR, they will be understood as standard "RGB" values. \fIRGB\fR is also the first entry here for the \fIRGB family\fR. This is especially noteworthy since many operations default to OK\-type spaces like OKLAB or OKHSL, but CIELAB and HSL are higher in search order. .SH SYNTAX .IX Header "SYNTAX" Whenever a color space name is used within a color definition, it has to be written as shown here in the chapter headings. But there is a rather great degree of freedom to write the name in various ways. First of all the name and its alias can be used synonymously by the user. Only when GTC writes a color definition, it never uses alias names. Secondly, upper and lower case are acceptable. Although some formats will force the output to be in a certain casing style. Thirdly, there is a list of acceptable, special characters as: underscore \fI\*(Aq_\*(Aq\fR, dash \fI\*(Aq\-\*(Aq\fR, whitespace \fI\*(Aq \*(Aq\fR and dot \fI\*(Aq.\*(Aq\fR. They might be inserted into names to write them like \fI\*(AqBT.2020\*(Aq\fR, but that\*(Aqs optional. .SH TERMS .IX Header "TERMS" The "SYNTAX" section already explained the relation between a \fBname\fR and \fBalias name\fR and the section before laid out what a space "FAMILY" is and why there is the concept of an \fBaxis role\fR. The "INTRODUCTION" told about long and short \fBaxes names\fR, axis \fBranges\fR, \fInormal\fR ranges and \fBgamut\fR. Large gamut just means a space encompasses more colors than other spaces. The \fBwhitepoint\fR is the set of values that represent pure white in a certain space. The conversion between spaces is always a mathematical algorithm, but some conversions are simpler than others. Some are fulfilled by just one operation. There the values of the color are taken as vector that gets multiplied with a \fBconversion matrix\fR to obtain the values in the target space. And sometimes conversions consist just of scaling, where a gamma value gets applied to every color value: \f(CW\*(C`$value = $value ** $gamma\*(C'\fR. In some cases there are some additional operations to smooth out the edges of the curve. But in any case this procedure is called \fBtransfer function\fR. .SH "RGB family" .IX Header "RGB family" .SS RGB .IX Subsection "RGB" (alias name is \fBSRGB\fR \- standard RGB) is the default color space of this module internally and for input and output. It is used by most computer hardware like monitors and follows the logic of additive color mixing as produced by an overlay of three colored light beams. The sum of all colors will be white, as opposed to subtractive mixing. \&\fIRGB\fR is a completely Cartesian (Euclidean) 3D space and thus an \fIRGB\fR tuple consists of three integer values: .PP \&\fBred\fR (short \fBr\fR) range: 0 .. 255, \fBgreen\fR (short \fBg\fR) range: 0 .. 255 and \fBblue\fR (short \fBb\fR) range: 0 .. 255. A higher value means that a stronger amount of that base color flows into the mix that is displayed on a black background. Therefore black is (0, 0, 0), white (255, 255, 255) and a pure red (fully saturated color) is (255, 0, 0). RGB has a gamma of 2.4, but a piecewise transfer function, which is clipped at the corners (around the normalized values of zero and one). .SS LinearRGB .IX Subsection "LinearRGB" (alias name is \fBLinRGB\fR) Same as "RGB" but with normal value ranges (0 .. 1) and removed piecewise gamma correction. That means there is a linear correlation between the shown values and the RGB brightness of the pixel on the screen without any adaptation to human sensibilities. Its alias name is \fBLinRGB\fR. .SS CIEXYZ .IX Subsection "CIEXYZ" this space (alias \fBXYZ\fR) has the axis \fBX\fR, \fBY\fR and \fBZ\fR (long and short axis names are this time the same), that refer to the red, green and blue receptors (cones) in the retina (on the back side of the eye). Because those cones measure a lot more left and right than just exactly those colors, they got these technical names. The values in that space tell you about the amount of chemical and neurological activity a color produces inside the eye. The values ranges are always from zero and reach 95.047 on the \&\f(CW\*(C`X\*(C'\fR \- axis, 100 on \f(CW\*(C`Y\*(C'\fR and 108.883 on \f(CW\*(C`Z\*(C'\fR, due to the used white point of \fID65\fR which has these values divided by 100. The illuminant \&\fID65\fR is standard for all CIE spaces except \fICIERGB\fR. .SS CIERGB .IX Subsection "CIERGB" 1931 standardized, normal valued (0 .. 1) space with same axis as "RGB": \&\fIred\fR (\fIr\fR), \fIgreen\fR (\fIg\fR) and \fIblue\fR (\fIb\fR). It has the illuminant E and no gamma (linear RGB). .SS AdobeRGB .IX Subsection "AdobeRGB" (alias name \fBopRGB\fR) is a normalized "RGB" variant with the CIE white point D65 a gamma of about 2.2. .SS AppleRGB .IX Subsection "AppleRGB" normal "RGB" variant with white point of D65 and gamma is 1.8. It is the legacy color space Apple used in the 90ies. .SS ProPhotoRGB .IX Subsection "ProPhotoRGB" (alias name \fBROMMRGB\fR) normal "RGB" variant with a white point of D50, gamma = 1.8 and a wide gamut. .SS WideGamutRGB .IX Subsection "WideGamutRGB" Even greater gamut then previous spaces with white point D50 and gamma of ~2.2. .SS "Display P3" .IX Subsection "Display P3" wide gamut RGB variant with same gamma function as "RGB", has alias name \fBP3\fR. .SS "Display P3 Linear" .IX Subsection "Display P3 Linear" P3 variant without any gamma \- wider gamut variant of \eLinearRGB. .SS DCI\-P3 .IX Subsection "DCI-P3" Simply \fIDisplay P3 Linear\fR with a gamma of 2.4, has alias name \fBSMPTE P3\fR. .SS "DCI\-P3 Linear" .IX Subsection "DCI-P3 Linear" DCI variant without gamma .SS Rec.709 .IX Subsection "Rec.709" RGB space, has alias name \fBBT.709\fR. .SS Rec.2020 .IX Subsection "Rec.2020" RGB space, has alias name \fBBT.2020\fR. .SH "LAB family" .IX Header "LAB family" .SS CIELAB .IX Subsection "CIELAB" (alias \fBLAB\fR) is a derivate of "CIEXYZ" that reorders the colors along axis that reflect how the brain processes them. It uses three information channels. One named \fBL\fR (lightness) with a real value range of (0 .. 100). Second is channel \fBa\fR, that reaches from red to green (\-500 .. 500) and thirdly \fBb\fR from yellow to blue (\-200 .. 200). Values will be displayed with three decimals. The long names of the axis names contain a \*(Aq*\*(Aq and are thus: \fBL*\fR, \fBa*\fR and \fBb*\fR. The \fIa\fR and \fIb\fR axis reflect the opponent color theory. .SS HunterLAB .IX Subsection "HunterLAB" predecessor of "CIELAB" by Richard S. Hunter with no alias name and slightly different color transitions on yellow\-blue\-direction. The axis have same long and short names: \fBL\fR with normal values (0 .. 1), \&\fBa\fR \-172.30 .. 172.30 and \fBb\fR \-67.20 .. 67.20. .SS CIELUV .IX Subsection "CIELUV" (alias \fBLUV\fR) is a more perceptually uniform version of "CIELAB" and the axis \fIa\fR and \fIb\fR got renamed to \fIu\fR and \fIv\fR (see "YUV") but did not change their meaning. It has also three Cartesian dimension named \&\fBL*\fR, \fBu*\fR and \fBv*\fR, (short names have only the first letter of these names). They have real valued ranges, which are 0 .. 100, \-134 .. 220 and \&\-140 .. 122. .SS OKLAB .IX Subsection "OKLAB" is a modern improvement of "CIELAB" by Bjoern Ottosson with no alias name and for nicer color transitions and better numeric behaviour. The axis long names are same as the same ones: \fBL\fR with values (0 .. 1), \&\fBa\fR and \fBb\fR with both (\-0.5 .. 0.5). If you want to use it like in \fBCSS\fR, just add \f(CW\*(C`range => [100, [\-120,120], [\-120,120]], suffix => \*(Aq%\*(Aq\*(C'\fR. .SS YIQ .IX Subsection "YIQ" Is a space developed for \fINTSC\fR to broadcast a colored television signal, which is still compatible with black and white TV. It achieves this by sending the \fBluminance\fR (short \fIy\fR) (sort of brightness with real range of 0 .. 1) in channel number one, which is all black and white TV needs. Additionally we have the axis of \fBin\-phase\fR (short \fBi\fR) (cyan \- orange \- balance, range \-0.5959 .. 0.5959) and \&\fBquadrature\fR (short \fBq\fR) (magenta \- green \- balance, range: \-0.5227 .. 0.5227). .SS YPbPr .IX Subsection "YPbPr" Is a slightly altered version of YIQ for the \fIPAL\fR TV standard. We use a variant called \fBYUV\fR, which can also be used as space name. It has computation friendly value ranges and is still relevant in video and image formats and compression algorithms, but under the name \fIYCbCr\fR. The only difference is that \fIYCbCr\fR works with digital values but this module computes with real (analogue) values to enable any precision the user might prefer. To make this clear, this space holds the name \fBYPbPr\fR. It has three Cartesian axis: 1. \fBluma\fR (short \fBy\fR) with a real value range of 0..1, 2. \fBPb\fR (short \fIu\fR, \-0.5 .. 0.5) and 3. \fBPr\fR (short \fIv\fR, \-0.5 .. 0.5). (see also "CIELUV") .SH "HSL family" .IX Header "HSL family" .SS HSL .IX Subsection "HSL" \&.. is a cylindrical space that orders colors along cognitive properties. The first dimension is the angular one and it rotates in 360 degrees around the rainbow of fully saturated colors: 0 = red, 15 approximates orange, 60 \- yellow 120 \- green, 180 \- cyan, 240 \- blue, 270 \- violet, 300 \- magenta, 330 \- pink. 0 and 360 points to the same coordinate. This module only outputs 0, even if accepting 360 as input. The second, linear dimension (axis) measures the distance between a point the center column of the cylinder at the same height, no matter in which direction. The center column has the value 0 (white .. gray .. black) and the outer mantle of the cylinder contains the most saturated, purest colors. The third, vertical axis reaches from bottom value 0 (always black no matter the other values) to 100 (always white no matter the other values). In summary: HSL needs three integer values: \fBhue\fR (short \fBh\fR) (0 .. 360), \&\fBsaturation\fR (short \fBs\fR) (0 .. 100) and \fBlightness\fR (short \fBl\fR) (0 .. 100). .SS OKHSL .IX Subsection "OKHSL" \&\fBOKHSL\fR is a variant of \fIHSL\fR for perceptual uniformity by Bjoern Ottosson. It has no alias name and the same axis names: \fBhue\fR (short \fBh\fR) (0 .. 360), \&\fBsaturation\fR (short \fBs\fR) (0 .. 1) and \fBlightness\fR (short \fBl\fR) (0 .. 1). .SS CIELCHab .IX Subsection "CIELCHab" (alias \fBLCH\fR) is the cylindrical version of the "CIELAB" with the dimensions \fBluminance\fR, \fBchroma\fR and \fBhue\fR \- in short \fBl\fR, \fBc\fR and \fBh\fR, with the roles of \fBlightness\fR, \fBsaturation\fR and \fBhue\fR. The real valued ranges are from zero to 100, 539 and 360 respectively. Like with the "HSL" and "HSV", hue is the circular dimension and its value is meant as degrees in a circle. For gray colors in the middle column the value \fIhue\fR has no importance and will in this implementation always be zero. .SS CIELCHuv .IX Subsection "CIELCHuv" (alias \fBLCHuv\fR) is the cylindrical version of the "CIELUV" and works similar to CIELCHab except the real valued range of \fBchroma\fR is (0 .. 261) and the space has no alias name. .SS OKLCH .IX Subsection "OKLCH" is the cylindrical variant of "OKLAB" just parallels "CIELCHab". The axis names are again: \fBluminance\fR, \fBchroma\fR and \fBhue\fR \- in short: \&\fBl\fR, \fBc\fR and \fBh\fR with the roles of \fBlightness\fR, \fBsaturation\fR and \fBhue\fR. Value ranges are similar as in \f(CW\*(C`OKLAB\*(C'\fR: \&\fIluminance\fR 0 .. 1 (normal), \fIchroma\fR 0 .. 0.5 and \fIhue\fR are angles of 0 .. 360 degrees. Also if you prefer a \fBCSS\fR compatible format, use \f(CW\*(C`range => [100, 120, 360]\*(C'\fR and a preferred suffix. .SH "HSV family" .IX Header "HSV family" .SS HSV .IX Subsection "HSV" \&... is also cylindrical but is shaped like a cone. Similar to HSL we have \fBhue\fR and \fBsaturation\fR, but the third axis is named \fBvalue\fR (short \fBv\fR). In HSL we always get white, when \fIlightness\fR is 100. In HSV additionally \fIsaturation\fR has to be zero to get white. When \fIsaturation\fR is 100 and \fIvalue\fR is 100 we have the purest, most saturated color of whatever \fIhue\fR sets. So unlike in \f(CW\*(C`HSL\*(C'\fR, here every color has its unique coordinates. .SS HSB .IX Subsection "HSB" Is an alias to "HSV", just the \fIvalue\fR axis is renamed with \fBbrightness\fR (\fBb\fR). .SS OKHSV .IX Subsection "OKHSV" \&\fBOKHSL\fR is a variant of \fIHSV\fR for percepual uniformity. It has no alias name and the same axis names: \fBhue\fR (short \fBh\fR) (0 .. 360), \&\fBsaturation\fR (short \fBs\fR) (0 .. 1) and \fBvalue\fR (short \fBv\fR) (0 .. 1). .SH "HWB family" .IX Header "HWB family" .SS HWB .IX Subsection "HWB" An inverted "HSV", where the saturated, pure colors are on the center column of the cylinder. It still has the same circular \fBhue\fR dimension with an integer range of 0 .. 360. The other two, linear dimensions (also 0 .. 100 integer range with optional suffix \*(Aq%\*(Aq) are \fBwhiteness\fR (\fBw\fR) and \fBblackness\fR (\fBb\fR). They describe how much white or black are mixed into the pure hue. If both are zero, you get a pure color. \&\fIwhiteness\fR of 100 always leads to white and \fIblackness\fR of 100 always leads to black. The space is truncated as a cone so the sum of \fIwhiteness\fR and \fIblackness\fR can never be greater than 100. .SS NCol .IX Subsection "NCol" Is a more human readable variant of the "HWB" space with an altered \&\fBhue\fR values, that consists of a letter and two digits. The letter demarks one of the six areas around the rainbow. \fBR\fR is \fIRed\fR, \&\fBY\fR (\fIYellow\fR), \fBG\fR (\fIGreen\fR), \fBC\fR (\fICyan\fR), \fBB\fR (\fIBlue\fR), \&\fBM\fR (\fIMagenta\fR). The two digits after this letter are an angular value, measuring the distance between the pure color (as stated by the letter) and the described color (toward the next color on the rainbow). The \fBwhiteness\fR and \fBblackness\fR axis have integer values with the suffix \fI\*(Aq%\*(Aq\fR, since they are percentual values as well. .SS OKHWB .IX Subsection "OKHWB" \&\fBOKHWB\fR is a variant of \fIHWB\fR for percepual uniformity. It has no alias name and the same axis names: \fBhue\fR (short \fBh\fR) (0 .. 360), \&\fBwhiteness\fR (short \fBw\fR) (0 .. 1) and \fBblackness\fR (short \fBb\fR) (0 .. 1). .SH Other .IX Header "Other" .SS CMY .IX Subsection "CMY" is the opposite of "RGB" since it follows the logic of subtractive color mixing as used in printing. Think of it as the amount of colored ink on white paper, so that white is (0,0,0) and black (1,1,1). It uses normalized real value ranges: 0 .. 1. An CMY tuple has also three values: .PP \&\fBcyan\fR (short \fBc\fR) is the inverse of \fIred\fR, \&\fBmagenta\fR (short \fBm\fR ) is inverse to \fIgreen\fR and \&\fByellow\fR (short \fBy\fR) is inverse of \fIblue\fR. .SS CMYK .IX Subsection "CMYK" is an extension of "CMY" with a fourth value named \fBkey\fR (short \fBk\fR), which is the amount of black ink mixed into the CMY color. It also has an normalized range of 0 .. 1. This should not bother you since you are free to change the range at your preference. .SH AUTHOR .IX Header "AUTHOR" Herbert Breunung, .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2026 Herbert Breunung. .SH LICENSE .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.