pub trait Colored: Sized {
    // Required methods
    fn mul_rgba(self, r: f32, g: f32, b: f32, a: f32) -> Self;
    fn hue_rad(self, angle: f32) -> Self;

    // Provided methods
    fn tint(self, f: f32) -> Self { ... }
    fn shade(self, f: f32) -> Self { ... }
    fn hue_deg(self, angle: f32) -> Self { ... }
}
Expand description

Implemented by contexts that contains color.

Required Methods§

source

fn mul_rgba(self, r: f32, g: f32, b: f32, a: f32) -> Self

Multiplies with red, green, blue and alpha values.

source

fn hue_rad(self, angle: f32) -> Self

Rotates hue by radians.

Provided Methods§

source

fn tint(self, f: f32) -> Self

Mixes the current color with white.

0 is black and 1 is white.

source

fn shade(self, f: f32) -> Self

Mixes the current color with black.

0 is white and 1 is black.

source

fn hue_deg(self, angle: f32) -> Self

Rotates hue by degrees.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Colored for [f32; 4]

source§

fn mul_rgba(self, r: f32, g: f32, b: f32, a: f32) -> [f32; 4]

source§

fn hue_rad(self, angle: f32) -> [f32; 4]

Implementors§