pub struct Color(pub u16);
Expand description
On the GBA, colors have 5 bits per channel.
In order of increasing bit, the channel ordering is red, green, blue. The high bit is ignored.
0bIBBB_BBGG_GGGR_RRRR
Tuple Fields§
§0: u16
Implementations§
Source§impl Color
impl Color
Sourcepub const fn from_rgb(r: u16, g: u16, b: u16) -> Self
pub const fn from_rgb(r: u16, g: u16, b: u16) -> Self
Assembles a color from channel values.
Illegal channel values (>31) will just combine weirdly.
pub const fn red(self) -> u16
pub const fn with_red(self, u: u16) -> Self
pub fn set_red(&mut self, u: u16)
pub const fn green(self) -> u16
pub const fn with_green(self, u: u16) -> Self
pub fn set_green(&mut self, u: u16)
pub const fn blue(self) -> u16
pub const fn with_blue(self, u: u16) -> Self
pub fn set_blue(&mut self, u: u16)
Trait Implementations§
impl Copy for Color
impl Eq 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