mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-12 01:51:34 +11:00
Add methods for getting and setting a palette colour
This commit is contained in:
parent
a92a2f503c
commit
5c10af2f72
|
@ -7,4 +7,12 @@ impl Palette16 {
|
||||||
pub const fn new(colours: [u16; 16]) -> Self {
|
pub const fn new(colours: [u16; 16]) -> Self {
|
||||||
Palette16 { colours }
|
Palette16 { colours }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn update_colour(&mut self, index: usize, colour: u16) {
|
||||||
|
self.colours[index] = colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_colour(&self, index: usize) -> u16 {
|
||||||
|
self.colours[index]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue