pub trait IColor: Sized + ToColor<Self::Component> {
type Component: Primitive;
Show 19 associated constants and 7 methods
const TRANSPARENT: Self;
const BLACK: Self;
const GREY: Self;
const WHITE: Self;
const RED: Self;
const GREEN: Self;
const BLUE: Self;
const CYAN: Self;
const MAGENTA: Self;
const YELLOW: Self;
const SPRING: Self;
const AZURE: Self;
const VIOLET: Self;
const ROSE: Self;
const ORANGE: Self;
const LIME: Self;
const CANARY: Self;
const PINK: Self;
const GLACE: Self;
// Required methods
fn to_rgba_of<R>(self) -> RgbaOf<R>
where R: Primitive + CastRangeFrom<Self::Component>;
fn to_hsla_of<R>(self) -> HslaOf<R>
where R: Float + CastRangeFrom<Self::Component>;
fn from_rgba_u8(rgba: RgbaOf<u8>) -> Self;
fn from_rgba_u16(rgba: RgbaOf<u16>) -> Self;
fn from_rgba_f32(rgba: RgbaOf<f32>) -> Self;
fn from_rgba_f64(rgba: RgbaOf<f64>) -> Self;
fn from_rgba_float(rgba: RgbaOf<f32>) -> Self;
}Expand description
Constant color name are based on https://colornames.org/
(+-1 u8 unit per channel, otherwise #FF7F00 should be named Orange Juice and not Orange, because Orange is #FF7F00)
Required Associated Constants§
const TRANSPARENT: Self
Required Associated Types§
Required Methods§
fn to_rgba_of<R>(self) -> RgbaOf<R>
fn to_hsla_of<R>(self) -> HslaOf<R>
fn from_rgba_u8(rgba: RgbaOf<u8>) -> Self
fn from_rgba_u16(rgba: RgbaOf<u16>) -> Self
fn from_rgba_f32(rgba: RgbaOf<f32>) -> Self
fn from_rgba_f64(rgba: RgbaOf<f64>) -> Self
fn from_rgba_float(rgba: RgbaOf<f32>) -> Self
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.