pub trait Colored: Sized {
// Required methods
fn mul_rgba(
self,
r: ColorComponent,
g: ColorComponent,
b: ColorComponent,
a: ColorComponent,
) -> Self;
fn hue_rad(self, angle: ColorComponent) -> Self;
// Provided methods
fn tint(self, f: ColorComponent) -> Self { ... }
fn shade(self, f: ColorComponent) -> Self { ... }
fn hue_deg(self, angle: ColorComponent) -> Self { ... }
}
Expand description
Implemented by contexts that contains color.
Required Methods§
Sourcefn mul_rgba(
self,
r: ColorComponent,
g: ColorComponent,
b: ColorComponent,
a: ColorComponent,
) -> Self
fn mul_rgba( self, r: ColorComponent, g: ColorComponent, b: ColorComponent, a: ColorComponent, ) -> Self
Multiplies with red, green, blue and alpha values.
Sourcefn hue_rad(self, angle: ColorComponent) -> Self
fn hue_rad(self, angle: ColorComponent) -> Self
Rotates hue by radians.
Provided Methods§
Sourcefn tint(self, f: ColorComponent) -> Self
fn tint(self, f: ColorComponent) -> Self
Mixes the current color with white.
0 is black and 1 is white.
Sourcefn shade(self, f: ColorComponent) -> Self
fn shade(self, f: ColorComponent) -> Self
Mixes the current color with black.
0 is white and 1 is black.
Sourcefn hue_deg(self, angle: ColorComponent) -> Self
fn hue_deg(self, angle: ColorComponent) -> Self
Rotates hue by degrees.
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.