From 31d7ff52ca8f3af232443cb93911f26fccd927e8 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 7 Nov 2020 13:48:38 +0000 Subject: [PATCH] done --- src/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3456230..bb1273d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -166,11 +166,9 @@ fn image_to_base64(image: &DynamicImage) -> String { fn render_preview(state: &State) -> DynamicImage { let mut buffer = state.image.as_ref().unwrap().clone().into_rgba(); - - // todo get actual chosen palette - let palette_id = state.palette.as_ref().unwrap(); - let palette = *&state.game.as_ref().unwrap().get_palette(palette_id).unwrap(); - let colour_map = crate::ColourMap::from(palette); + let palette_id = state.palette.as_ref().unwrap(); + let palette = *&state.game.as_ref().unwrap().get_palette(palette_id).unwrap(); + let colour_map = crate::ColourMap::from(palette); let mut buffer = image::imageops::brighten(&mut buffer, state.brightness);