Compare commits
2 Commits
f2d3f5ec07
...
5a5c5d4d9b
Author | SHA1 | Date |
---|---|---|
|
5a5c5d4d9b | |
|
fb6f09fce5 |
|
@ -1 +1 @@
|
|||
Subproject commit 185362e6cd1c0f668a186adde2522da2f0d45307
|
||||
Subproject commit 459a16076a1e58f503e9278a41f633e2e870c28e
|
|
@ -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] {
|
||||
|
|
Loading…
Reference in New Issue