Trait bevy_color::prelude::ColorToComponents
source · 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
Object Safety§
This trait is not object safe.