Trait bevy_color::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§

source

fn to_f32_array(self) -> [f32; 4]

Convert to an f32 array

source

fn to_f32_array_no_alpha(self) -> [f32; 3]

Convert to an f32 array without the alpha value

source

fn to_vec4(self) -> Vec4

Convert to a Vec4

source

fn to_vec3(self) -> Vec3

Convert to a Vec3

source

fn from_f32_array(color: [f32; 4]) -> Self

Convert from an f32 array

source

fn from_f32_array_no_alpha(color: [f32; 3]) -> Self

Convert from an f32 array without the alpha value

source

fn from_vec4(color: Vec4) -> Self

Convert from a Vec4

source

fn from_vec3(color: Vec3) -> Self

Convert from a Vec3

Object Safety§

This trait is not object safe.

Implementors§