diff --git a/src/window/vip/utils.rs b/src/window/vip/utils.rs index 76df3bf..ef603df 100644 --- a/src/window/vip/utils.rs +++ b/src/window/vip/utils.rs @@ -3,12 +3,12 @@ use egui::{Color32, Image, ImageSource, Response, Sense, TextureOptions, Ui, Wid pub const GENERIC_PALETTE: [u8; 4] = [0, 32, 64, 128]; pub fn shade(brt: u8, color: Color32) -> Color32 { - let corrected = if brt & 0x80 != 0 { - 255 + let corrected = if brt > 132 { + 255.0 } else { - (brt << 1) | (brt >> 6) + (brt as f32 * 255.0 / 133.0).round() }; - color.gamma_multiply(corrected as f32 / 255.0) + color.gamma_multiply(corrected / 255.0) } pub fn generic_palette(color: Color32) -> [Color32; 4] {