pub struct Color {
pub r: u8,
pub g: u8,
pub b: u8,
pub a: u8,
}
Expand description
Represents a color, holding red, green, blue and alpha values as u8
each.
Fields§
§r: u8
§g: u8
§b: u8
§a: u8
Trait Implementations§
Source§impl Index<ColorChannel> for Color
Indexing implementation for the Color
struct using ColorChannel
as index.
impl Index<ColorChannel> for Color
Indexing implementation for the Color
struct using ColorChannel
as index.
§Examples
use iris_lib::color::{Color, ColorChannel};
let color = Color { r: 1, g: 2, b: 3, a: 4 };
assert_eq!(1, color[ColorChannel::R]);
assert_eq!(2, color[ColorChannel::G]);
assert_eq!(3, color[ColorChannel::B]);
assert_eq!(4, color[ColorChannel::A]);
impl Copy for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
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