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 moreimpl Copy for ColorSpace
Source§impl Debug for ColorSpace
impl Debug for ColorSpace
Source§impl Default for ColorSpace
impl Default for ColorSpace
Source§fn default() -> ColorSpace
fn default() -> ColorSpace
impl Eq for ColorSpace
Source§impl PartialEq for ColorSpace
impl PartialEq for ColorSpace
impl StructuralPartialEq for ColorSpace
Auto Trait Implementations§
impl Forget for ColorSpace
impl Freeze for ColorSpace
impl Move for ColorSpace
impl RefUnwindSafe for ColorSpace
impl Send for ColorSpace
impl Sync for ColorSpace
impl Unpin for ColorSpace
impl UnsafeUnpin for ColorSpace
impl UnwindSafe for ColorSpace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more