pub trait Saturation: Sized {
// Required methods
fn with_saturation(&self, saturation: f32) -> Self;
fn saturation(&self) -> f32;
fn set_saturation(&mut self, saturation: f32);
}
Expand description
Trait for manipulating the saturation of a color.
When working with color spaces that do not have native saturation components
the operations are performed in crate::Hsla
.
Required Methods§
Sourcefn with_saturation(&self, saturation: f32) -> Self
fn with_saturation(&self, saturation: f32) -> Self
Return a new version of this color with the saturation channel set to the given value.
Sourcefn saturation(&self) -> f32
fn saturation(&self) -> f32
Return the saturation of this color [0.0, 1.0].
Sourcefn set_saturation(&mut self, saturation: f32)
fn set_saturation(&mut self, saturation: f32)
Sets the saturation of this color.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.