Add methods for getting and setting a palette colour

This commit is contained in:
Gwilym Kuiper 2021-10-30 21:16:40 +01:00
parent a92a2f503c
commit 5c10af2f72

View file

@ -7,4 +7,12 @@ impl Palette16 {
pub const fn new(colours: [u16; 16]) -> Self {
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]
}
}