pub trait Alpha: Sized {
// Required methods
fn with_alpha(&self, alpha: f32) -> Self;
fn alpha(&self) -> f32;
fn set_alpha(&mut self, alpha: f32);
// Provided methods
fn is_fully_transparent(&self) -> bool { ... }
fn is_fully_opaque(&self) -> bool { ... }
}
Expand description
Methods for manipulating alpha values.
Required Methods§
Sourcefn with_alpha(&self, alpha: f32) -> Self
fn with_alpha(&self, alpha: f32) -> Self
Return a new version of this color with the given alpha value.
Provided Methods§
Sourcefn is_fully_transparent(&self) -> bool
fn is_fully_transparent(&self) -> bool
Is the alpha component of this color less than or equal to 0.0?
Sourcefn is_fully_opaque(&self) -> bool
fn is_fully_opaque(&self) -> bool
Is the alpha component of this color greater than or equal to 1.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.