Color.AdobeRGB
(Color v0.4.0)
Copy Markdown
Adobe RGB (1998) color space, using the Lindbloom Adobe working space
(primaries from Adobe RGB (1998) specification, D65 reference white)
and simple gamma companding with γ = 2.19921875.
Channels r, g, b are unit floats in [0, 1].
Summary
Functions
Converts a CIE XYZ color (assumed D65/2°) to Adobe RGB.
Converts an Adobe RGB color to a CIE XYZ color.
Types
Functions
Converts a CIE XYZ color (assumed D65/2°) to Adobe RGB.
Arguments
xyzis aColor.XYZstruct.
Returns
- A
Color.AdobeRGBstruct.
Examples
iex> xyz = %Color.XYZ{x: 0.95047, y: 1.0, z: 1.08883, illuminant: :D65, observer_angle: 2}
iex> {:ok, adobe} = Color.AdobeRGB.from_xyz(xyz)
iex> {Float.round(adobe.r, 3), Float.round(adobe.g, 3), Float.round(adobe.b, 3)}
{1.0, 1.0, 1.0}
Converts an Adobe RGB color to a CIE XYZ color.
Arguments
adobeis aColor.AdobeRGBstruct with unit-range channels.
Returns
- A
Color.XYZstruct tagged with D65/2°,Y ∈ [0, 1].
Examples
iex> {:ok, xyz} = Color.AdobeRGB.to_xyz(%Color.AdobeRGB{r: 1.0, g: 1.0, b: 1.0})
iex> {Float.round(xyz.x, 4), Float.round(xyz.y, 4), Float.round(xyz.z, 4)}
{0.9505, 1.0, 1.0888}