Struct ori_graphics::Color
source · #[repr(C)]pub struct Color {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}
Fields§
§r: f32
§g: f32
§b: f32
§a: f32
Implementations§
source§impl Color
impl Color
pub const TRANSPARENT: Self = _
pub const BLACK: Self = _
pub const WHITE: Self = _
pub const RED: Self = _
pub const GREEN: Self = _
pub const BLUE: Self = _
pub const YELLOW: Self = _
pub const CYAN: Self = _
pub const MAGENTA: Self = _
pub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> Self
pub const fn rgb(r: f32, g: f32, b: f32) -> Self
pub fn rgba8(r: u8, g: u8, b: u8, a: u8) -> Self
pub fn rgb8(r: u8, g: u8, b: u8) -> Self
pub fn try_hex(hex: &str) -> Option<Self>
pub fn hex(hex: &str) -> Self
pub fn to_hex(self) -> String
pub fn is_translucent(self) -> bool
pub fn to_linear(self) -> [f32; 4]
Trait Implementations§
source§impl AddAssign<Color> for Color
impl AddAssign<Color> for Color
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl PartialEq<Color> for Color
impl PartialEq<Color> for Color
impl Copy for Color
impl Pod for Color
impl StructuralPartialEq 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
.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<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()
.