pub enum ColorSpace {
Srgb,
ExtendedSrgb,
DisplayP3,
}Expand description
The primaries a color’s components are stated against.
A color is three numbers and a rule for reading them, and the rule is this. Two colors with identical components and different spaces are different colors, which is why combining them without saying which space the result is in gives an answer that is subtly wrong rather than obviously so.
Variants§
Srgb
sRGB primaries, components meant to lie between zero and one.
ExtendedSrgb
sRGB primaries with no range expectation.
The same primaries as Self::Srgb, so converting between the two
moves nothing: what differs is what a caller means by a component
outside zero to one, not where the color is. This is the space this
renderer works in, and a component outside that range is a color the
sRGB primaries cannot describe rather than a mistake.
DisplayP3
Display P3 primaries, which contain the sRGB ones and reach further into the greens and reds.
Shares sRGB’s white point and its blue primary, so white and pure blue mean the same thing in both and only the other two axes move.
Trait Implementations§
Source§impl Clone for ColorSpace
impl Clone for ColorSpace
Source§fn clone(&self) -> ColorSpace
fn clone(&self) -> ColorSpace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more