developed in the most modern and scientific models. Color conversion formulae To convert from HSL or HSV to RGB, we essentially invert the steps listed above (as before, ). First, we compute chroma, by multiplying saturation by the maximum chroma for a given lightness or value. Next, we find the point on one of the bottom three faces of the RGB cube which has the same hue and chroma as our color (and therefore projects onto the same point in the chromaticity plane). Finally, we add equal amounts of R, G, and B to reach the proper lightness or value. To RGB HSL to RGB Given a color with hue , saturation , and lightness , we first find chroma: Then we can find a point along the bottom three faces of the RGB cube, with the same hue and chroma as our color (using the intermediate value X for the second largest component of this color): In the above equation, the notation refers to the remainder of the Euclidean division of by 2. is not necessarily an integer. When is an integer, the "neighbouring" formula would yield the same result, as or , as appropriate. Finally, we can find R, G, and B by adding the same amount to each component, to match lightness: HSL to RGB alternative The polygonal piecewise functions can be somewhat simplified by clever use of minimum and maximum values as well as the remainder operation. Given a color with hue , saturation , and lightness , we first define the function: where and: And output R,G,B values (from ) are: The above alternative formulas allow for shorter implementations. In the above formulas the operation also returns the fractional part of the module e.g. , and . The base shape is constructed as follows: is a "triangle" for which values greater or equal to −1 start from k=2 and end at k=10, and the highest point is at k=6. Then by we change values bigger than 1 to equal 1. Then by we change values less than −1 to equal −1. At this point, we get something similar to the red shape from fig. 24 after a vertical flip (where the maximum is 1 and the minimum is −1). The R,G,B functions of use this shape transformed in the following way: modulo-shifted on (by ) (differently for R,G,B) scaled on (by ) and shifted on