pub trait Color: Debug + Copy {
// Required methods
fn red(&self) -> f64;
fn green(&self) -> f64;
fn blue(&self) -> f64;
fn alpha(&self) -> f64;
fn red8(&self) -> u8;
fn green8(&self) -> u8;
fn blue8(&self) -> u8;
fn alpha8(&self) -> u8;
fn is_premultiplied(&self) -> bool;
// Provided methods
fn is_transparent(&self) -> bool { ... }
fn is_opaque(&self) -> bool { ... }
}Expand description
Access Color properties and compoents
Required Methods§
Sourcefn is_premultiplied(&self) -> bool
fn is_premultiplied(&self) -> bool
Return if the color has been premultiplied
Provided Methods§
Sourcefn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Return if the color is completely transparent, alpha = 0.0
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.