pub struct Palette {
pub colors: [Color; 3],
}
Expand description
A set of colors usable by tiles and sprites.
Tiles and sprites each have a bit depth of 2 bits per pixel, meaning that any given
tile or sprite can only use 4 total colors. For both tiles and sprites, the color index 0
always corresponds to transparency. The remaining indicies (1, 2, and 3) correspond to
the colors in a Palette
.
The Ppu
supports 4 different palettes for tiles, and a separate 4 palettes for sprites.
Fields§
§colors: [Color; 3]
The array of 3 colors in the palette.
Trait Implementations§
impl Copy for Palette
Auto Trait Implementations§
impl RefUnwindSafe for Palette
impl Send for Palette
impl Sync for Palette
impl Unpin 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