pub struct GbaColor(/* private fields */);
Expand description
RGB 5-bit per channel (bitpacked) linear(?) color data.
Bits are filled low to high. The highest bit is ignored:
0bI_BBBBB_GGGGG_AAAAA
This is the native color format of the GBA.
Implementations§
Source§impl GbaColor
impl GbaColor
pub const BLACK: Self
pub const RED: Self
pub const GREEN: Self
pub const YELLOW: Self
pub const BLUE: Self
pub const MAGENTA: Self
pub const CYAN: Self
pub const WHITE: Self
pub const fn new() -> Self
pub const fn red(self) -> u16
pub const fn green(self) -> u16
pub const fn blue(self) -> u16
pub const fn with_red(self, r: u16) -> Self
pub const fn with_green(self, g: u16) -> Self
pub const fn with_blue(self, b: u16) -> Self
Trait Implementations§
Source§impl PartialOrd for GbaColor
impl PartialOrd for GbaColor
impl Copy for GbaColor
impl Pod for GbaColor
impl StructuralPartialEq for GbaColor
Auto Trait Implementations§
impl Freeze for GbaColor
impl RefUnwindSafe for GbaColor
impl Send for GbaColor
impl Sync for GbaColor
impl Unpin for GbaColor
impl UnwindSafe for GbaColor
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,
Source§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
.