Compare commits
No commits in common. "5a5c5d4d9b8212842d3288f37c249ec76c00ec91" and "f2d3f5ec071a2ae4a69b047fd49e7827c11a700c" have entirely different histories.
5a5c5d4d9b
...
f2d3f5ec07
|
@ -1 +1 @@
|
|||
Subproject commit 459a16076a1e58f503e9278a41f633e2e870c28e
|
||||
Subproject commit 185362e6cd1c0f668a186adde2522da2f0d45307
|
|
@ -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 > 132 {
|
||||
255.0
|
||||
let corrected = if brt & 0x80 != 0 {
|
||||
255
|
||||
} else {
|
||||
(brt as f32 * 255.0 / 133.0).round()
|
||||
(brt << 1) | (brt >> 6)
|
||||
};
|
||||
color.gamma_multiply(corrected / 255.0)
|
||||
color.gamma_multiply(corrected as f32 / 255.0)
|
||||
}
|
||||
|
||||
pub fn generic_palette(color: Color32) -> [Color32; 4] {
|
||||
|
|
Loading…
Reference in New Issue