pub trait Color<T> {
const MIN: T;
const MAX: T;
const BLACK: Self;
const WHITE: Self;
const RED: Self;
const GREEN: Self;
const BLUE: Self;
const YELLOW: Self;
const MAGENTA: Self;
const CYAN: Self;
// Required methods
fn r(&self) -> T;
fn g(&self) -> T;
fn b(&self) -> T;
fn a(&self) -> T;
fn gray(&self) -> T;
fn gray_alpha(&self) -> Self;
fn premultiply(&self) -> Self;
fn blend(&self, src: Self, mode: BlendMode) -> Self;
}
Expand description
common color interface
Required Associated Constants§
const MIN: T
const MAX: T
const BLACK: Self
const WHITE: Self
const RED: Self
const GREEN: Self
const BLUE: Self
const YELLOW: Self
const MAGENTA: Self
const CYAN: Self
Required Methods§
fn r(&self) -> T
fn g(&self) -> T
fn b(&self) -> T
fn a(&self) -> T
Sourcefn gray_alpha(&self) -> Self
fn gray_alpha(&self) -> Self
converts the color to gray maintaining alpha.
Sourcefn premultiply(&self) -> Self
fn premultiply(&self) -> Self
premultiplies the alpha.
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.