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§

source

fn with_saturate(&self, amount: f32) -> Self

De/saturate color by percentage Negative amount increases saturation So -0.1 is 10% more saturated

source

fn with_brightness(&self, amount: f32) -> Self

Change brightness to amount So 1.1 is 10% brighter

Provided Methods§

source

fn saturate(&self) -> Self
where Self: Sized,

Increase saturation by 10%

source

fn desaturate(&self) -> Self
where Self: Sized,

Decrease saturation by 10%

source

fn lighten(&self) -> Self
where Self: Sized,

source

fn darken(&self) -> Self
where Self: Sized,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ChangeColors for Vec<Color>

source§

fn with_saturate(&self, amount: f32) -> Vec<Color>

source§

fn with_brightness(&self, amount: f32) -> Vec<Color>

Implementors§