# Colors

## Colors [3.4]

Colors in OpenVG other than those stored in image pixels are represented as non-premultiplied sRGBA color values. Color and alpha values lie in the range [0, 1] unless otherwise noted.

### Linear color space [3.4.2]

The linear lRGB color space is defined in terms of the standard CIE XYZ color space, following ITU Rec. 709 using a D65 white point:

### sRGB color space [3.4.2]

The sRGB color space defines values Rs, Gs, Bs in terms of the linear lRGB primaries by applying a gamma $γ$ mapping.

if $(x \le 0.00304)$

else

if $(x \le 0.03928)$

else

lRGB to sRGB conversion $\qquad (1)$

sRGB to lRGB conversion $\qquad (2)$

### Linear grayscale

The linear grayscale (luminance) color space is related to the linear lRGB color space by the equations:

The perceptually-uniform grayscale color space is related to the linear grayscale (luminance) color space by the $γ$ mapping:

Conversion from perceptually-uniform grayscale to sRGB is performed by replication:

### Color space conversions

The following table summarizes the steps needed to convert one color space into another. The source format is in the left column, and the destination format is in the top row. The numbers indicate the equations from this section that are to be applied, in left-to-right order:

Src/DstlRGBsRGBlLUMsLUM
lRGB-133, 5
sRGB2-2, 32, 3, 5
lLUM44, 1-5
sLUM7, 276-