Trait buffer_graphics_lib::prelude::changing::ChangeColors
source · pub trait ChangeColors {
// Required methods
fn with_saturate(&self, amount: f32) -> Self;
fn with_brightness(&self, amount: f32) -> Self;
// Provided methods
fn saturate(&self) -> Self
where Self: Sized { ... }
fn desaturate(&self) -> Self
where Self: Sized { ... }
fn lighten(&self) -> Self
where Self: Sized { ... }
fn darken(&self) -> Self
where Self: Sized { ... }
}
Required Methods§
sourcefn with_saturate(&self, amount: f32) -> Self
fn with_saturate(&self, amount: f32) -> Self
De/saturate color by percentage
Negative amount increases saturation
So -0.1
is 10% more saturated
sourcefn with_brightness(&self, amount: f32) -> Self
fn with_brightness(&self, amount: f32) -> Self
Change brightness to amount
So 1.1
is 10% brighter
Provided Methods§
sourcefn desaturate(&self) -> Selfwhere
Self: Sized,
fn desaturate(&self) -> Selfwhere
Self: Sized,
Decrease saturation by 10%
fn lighten(&self) -> Selfwhere
Self: Sized,
fn darken(&self) -> Selfwhere
Self: Sized,
Object Safety§
This trait is not object safe.