pub trait ColorToComponents {
// Required methods
fn to_f32_array(self) -> [f32; 4];
fn to_f32_array_no_alpha(self) -> [f32; 3];
fn to_vec4(self) -> Vec4;
fn to_vec3(self) -> Vec3;
fn from_f32_array(color: [f32; 4]) -> Self;
fn from_f32_array_no_alpha(color: [f32; 3]) -> Self;
fn from_vec4(color: Vec4) -> Self;
fn from_vec3(color: Vec3) -> Self;
}Expand description
Trait with methods for converting colors to non-color types
Required Methods§
Sourcefn to_f32_array(self) -> [f32; 4]
fn to_f32_array(self) -> [f32; 4]
Convert to an f32 array
Sourcefn to_f32_array_no_alpha(self) -> [f32; 3]
fn to_f32_array_no_alpha(self) -> [f32; 3]
Convert to an f32 array without the alpha value
Sourcefn from_f32_array(color: [f32; 4]) -> Self
fn from_f32_array(color: [f32; 4]) -> Self
Convert from an f32 array
Sourcefn from_f32_array_no_alpha(color: [f32; 3]) -> Self
fn from_f32_array_no_alpha(color: [f32; 3]) -> Self
Convert from an f32 array without the alpha value
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".