Struct tridify_rs::Color
source · #[repr(C)]pub struct Color {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}
Expand description
RGBA representation of colors. Each value goes from 0 to 1.
You can use the constants for some default values.
#Examples
use ldrawy::Color;
let white_color = Color::WHITE;
let white_color = Color::new(1.0, 1.0, 1.0, 1.0);
Fields§
§r: f32
§g: f32
§b: f32
§a: f32
Implementations§
source§impl Color
impl Color
pub const fn new(r: f32, g: f32, b: f32, a: f32) -> Self
pub const CLEAR: Color = _
pub const BLACK: Color = _
pub const GRAY: Color = _
pub const SILVER: Color = _
pub const WHITE: Color = _
pub const MAROON: Color = _
pub const RED: Color = _
pub const PURPLE: Color = _
pub const GREEN: Color = _
pub const LIME: Color = _
pub const YELLOW: Color = _
pub const BLUE_NAVY: Color = _
pub const BLUE: Color = _
pub const BLUE_TEAL: Color = _
pub const BLUE_AQUA: Color = _
pub fn to_rgba8(&self) -> [u8; 4]
Trait Implementations§
impl Copy for Color
impl Pod for Color
Auto Trait Implementations§
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.