pub trait IColor:
From<Color>
+ From<ColorByte>
+ From<ColorHSLA>
+ ToColorRep<ColorRGBA = ColorRGBA, ColorHSLA = ColorHSLA, ColorRGBAByte = ColorRGBAByte> {
const TRANSPARENT: Self;
const BLACK: Self;
const GRAY: Self;
const WHITE: Self;
const RED: Self;
const GREEN: Self;
const BLUE: Self;
const CYAN: Self;
const PINK: Self;
const YELLOW: Self;
// Required method
fn rgba_from_bytes(r: u8, g: u8, b: u8, a: u8) -> Self;
// Provided methods
fn rgba_from_bytes_slice(rgba: &[u8]) -> Self { ... }
fn from_rgb_hex(hex: u32) -> Self { ... }
fn from_rgba_hex(hex: u32) -> Self { ... }
fn to_rgba_hex(self) -> u32 { ... }
fn to_rgba_hex_string(self) -> String { ... }
}Required Associated Constants§
const TRANSPARENT: Self
const BLACK: Self
const GRAY: Self
const WHITE: Self
const RED: Self
const GREEN: Self
const BLUE: Self
const CYAN: Self
const PINK: Self
const YELLOW: Self
Required Methods§
Provided Methods§
fn rgba_from_bytes_slice(rgba: &[u8]) -> Self
fn from_rgb_hex(hex: u32) -> Self
fn from_rgba_hex(hex: u32) -> Self
Sourcefn to_rgba_hex(self) -> u32
fn to_rgba_hex(self) -> u32
Cast to color byte and convert to u32 using : #RRGGBBAA
Sourcefn to_rgba_hex_string(self) -> String
fn to_rgba_hex_string(self) -> String
Cast to color byte and format the color : #RRGGBBAA
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.