Trait bevy_color::ColorToPacked

source ·
pub trait ColorToPacked {
    // Required methods
    fn to_u8_array(self) -> [u8; 4];
    fn to_u8_array_no_alpha(self) -> [u8; 3];
    fn from_u8_array(color: [u8; 4]) -> Self;
    fn from_u8_array_no_alpha(color: [u8; 3]) -> Self;
}
Expand description

Trait with methods for converting colors to packed non-color types

Required Methods§

source

fn to_u8_array(self) -> [u8; 4]

Convert to [u8; 4] where that makes sense (Srgba is most relevant)

source

fn to_u8_array_no_alpha(self) -> [u8; 3]

Convert to [u8; 3] where that makes sense (Srgba is most relevant)

source

fn from_u8_array(color: [u8; 4]) -> Self

Convert from [u8; 4] where that makes sense (Srgba is most relevant)

source

fn from_u8_array_no_alpha(color: [u8; 3]) -> Self

Convert to [u8; 3] where that makes sense (Srgba is most relevant)

Object Safety§

This trait is not object safe.

Implementors§