about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgennyble <gen@nyble.dev>2024-01-14 11:33:01 -0600
committergennyble <gen@nyble.dev>2024-01-14 11:33:01 -0600
commit7a3a4b5f86b17015e174737fde6c4867682b17f8 (patch)
treeda24ab23bda9a5cd7c4bd024e3d53ac21163de5e
parent7ff755a3f0e962ca822b23d9f4e0595a9615865b (diff)
downloadgifed-7a3a4b5f86b17015e174737fde6c4867682b17f8.tar.gz
gifed-7a3a4b5f86b17015e174737fde6c4867682b17f8.zip
gifed: add set_palette method
i've written this code like three times so i am making sure i commit and push it this time, god damnit
-rw-r--r--gifed/src/gif.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/gifed/src/gif.rs b/gifed/src/gif.rs
index f11694a..06cf0b8 100644
--- a/gifed/src/gif.rs
+++ b/gifed/src/gif.rs
@@ -50,6 +50,11 @@ impl Gif {
 		self.descriptor.background_color_index = idx;
 	}
 
+	pub fn set_palette(&mut self, palette: Option<Palette>) {
+		self.descriptor.set_color_table_metadata(palette.as_ref());
+		self.palette = palette;
+	}
+
 	pub fn background_color(&self) -> Option<u8> {
 		// vii) Background Color Index - Index into the Global Color Table for
 		// the Background Color. The Background Color is the color used for