Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Wall.ColorSourceDefinition of colors, taken from Gg
include module type of struct include Gg.Color endThe type for colors in a device independent RGB color space with an alpha component. The color space is defined by a D65 white point and the ITU-R BT.709 primaries (corresponds to a linearized sRGB space). The alpha component represent the color's opacity ranging from 0., a fully transparent color, to 1. a completly opaque one.
v r g b a is the linear sRGB color (r, g, b, a) as a color value.
v r g b ~a is the sRGB color (r, g, b, a) converted to a Gg color value.
v_srgbi r g b ~a is the 24-bit sRGB color (r, g, b, a) converted to a Gg color value by (v_srgb (float r /. 255.) (float g /. 255.) (float b /. 255.) ~a)
gray a g is the sRGB color (g, g, g, a) converted to color a value.
blend src dst is src blended over dst using source over destination alpha blending. See Alvy Ray Smith. Image compositing fundamentals. 1995.
clamp c is c with all components clamped to [0;1]. nan components are left untouched.
with_a c a is the same color as c but with the alpha component a.
Note. In the following conversions all color spaces carry an alpha component. The alpha component is always left untouched by the conversions.
WARNING. Converting between color spaces may result in out of gamut colors whose components are out of the destination color space expected ranges. The client is responsible to handle these; for values of type color simply clamping these is one option. Currently some conversion do not even round trip due to floating point inaccuracies, see this issue, so it is a good idea to clamp the conversions to color.
The type for colors in the sRGB color space with an alpha component. This is the color space used, for example, by CSS.
to_srgbi c is the Gg color c as a 24-bit sRGB color (r, g, b, a), see v_srgbi.
The type for colors in the CIE L*u*v* color space with a D65 reference white point and an alpha component. The meaning and range of the components is:
0. to 100.-134. to 220.-140. to 122.The type for colors in the CIE L*C*huv color space with a D65 reference white point and an alpha component. This color space is CIE L*u*v* with polar coordinates, the meaning and range of the components is:
0. to 100.0. to 260.77 in practice.0. to 2pi.The type for colors in the CIE L*a*b* color space with a D50 reference white point and an alpha component. The meaning and range of the components is:
0. to 100.-128. to 127.The type for colors in the CIE L*C*h*ab color space with a D50 reference white point and an alpha component. This color space is CIE L*a*b* with polar coordinates, the meaning and range of the components is:
0. to 100.0. to 181.02, but less in practice.0. to 2pi.type space = [ | `XYZ| `Lab| `Luv| `YCbr| `Yxy| `RGB| `Gray| `HSV| `HLS| `CMYK| `CMY| `CLR2| `CLR3| `CLR4| `CLR5| `CLR6| `CLR7| `CLR8| `CLR9| `CLRA| `CLRB| `CLRC| `CLRD| `CLRE| `CLRF ]The type for color spaces. These correspond to the ICC v4 supported color space, see the specification, section 7.2.6.
pp_space s prints a textual representation of s on ppf.
The type for ICC color profiles. A color profile can describe the characteristics of a color space, an input or output device and provide a mapping to a profile connection space (PCS), which is either CIE L*a*b* or XYZ with a D50 white point. For more information about ICC profile consult the ICC FAQ and the ICC v4 specification.
This module defines only a profile for the color space of color and a grayscale color space.
profile_of_icc s is a profile from the ICC profile byte stream s. None is returned if s doesn't seem to be a ICC profile.
Note A profile value is returned if a color space can be extracted, it doesn't guarantee a correct ICC profile byte stream.