From 7a3a4b5f86b17015e174737fde6c4867682b17f8 Mon Sep 17 00:00:00 2001 From: gennyble Date: Sun, 14 Jan 2024 11:33:01 -0600 Subject: 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 --- gifed/src/gif.rs | 5 +++++ 1 file changed, 5 insertions(+) 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) { + self.descriptor.set_color_table_metadata(palette.as_ref()); + self.palette = palette; + } + pub fn background_color(&self) -> Option { // vii) Background Color Index - Index into the Global Color Table for // the Background Color. The Background Color is the color used for -- cgit 1.4.1-3-g733a5