pub struct Palette(/* private fields */);Expand description
A DMG palette (BGP / OBP0 / OBP1): one shade per color index. Object
palettes ignore color index 0 (transparent).
| Bit | Field | Access | Meaning |
|---|---|---|---|
| 7-6 | id3 | R/W | Shade for color index 3. |
| 5-4 | id2 | R/W | Shade for color index 2. |
| 3-2 | id1 | R/W | Shade for color index 1. |
| 1-0 | id0 | R/W | Shade for color index 0. |
Implementations§
Source§impl Palette
impl Palette
Sourcepub const fn with_id0_checked(self, value: Shade) -> Result<Self, ()>
pub const fn with_id0_checked(self, value: Shade) -> Result<Self, ()>
Shade for color index 0.
Bits: 0..2
Sourcepub const fn set_id0_checked(&mut self, value: Shade) -> Result<(), ()>
pub const fn set_id0_checked(&mut self, value: Shade) -> Result<(), ()>
Shade for color index 0.
Bits: 0..2
Sourcepub const fn with_id1_checked(self, value: Shade) -> Result<Self, ()>
pub const fn with_id1_checked(self, value: Shade) -> Result<Self, ()>
Shade for color index 1.
Bits: 2..4
Sourcepub const fn set_id1_checked(&mut self, value: Shade) -> Result<(), ()>
pub const fn set_id1_checked(&mut self, value: Shade) -> Result<(), ()>
Shade for color index 1.
Bits: 2..4
Sourcepub const fn with_id2_checked(self, value: Shade) -> Result<Self, ()>
pub const fn with_id2_checked(self, value: Shade) -> Result<Self, ()>
Shade for color index 2.
Bits: 4..6
Sourcepub const fn set_id2_checked(&mut self, value: Shade) -> Result<(), ()>
pub const fn set_id2_checked(&mut self, value: Shade) -> Result<(), ()>
Shade for color index 2.
Bits: 4..6
Sourcepub const fn with_id3_checked(self, value: Shade) -> Result<Self, ()>
pub const fn with_id3_checked(self, value: Shade) -> Result<Self, ()>
Shade for color index 3.
Bits: 6..8
Trait Implementations§
impl Copy for Palette
impl Eq for Palette
impl StructuralPartialEq for Palette
Auto Trait Implementations§
impl BankSafe for Palette
impl Freeze for Palette
impl RefUnwindSafe for Palette
impl Send for Palette
impl Sync for Palette
impl Unpin for Palette
impl UnsafeUnpin for Palette
impl UnwindSafe for Palette
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