fix: replace HSV df_fade_color with exact stacked blue compositing
This commit is contained in:
@@ -86,8 +86,18 @@ fn df_fade_color(z_diff: i32) -> Color {
|
||||
if z_diff <= 0 {
|
||||
return Color::WHITE;
|
||||
}
|
||||
let saturation = (z_diff as f32 / 8.0).clamp(0.0, 1.0);
|
||||
Color::hsv(194.7, saturation, 1.0 - saturation / 2.0)
|
||||
let n = (z_diff as f32).min(8_f32);
|
||||
let overlay_r = 133_f32 / 255_f32;
|
||||
let overlay_g = 167_f32 / 255_f32;
|
||||
let overlay_b = 178_f32 / 255_f32;
|
||||
let layer_alpha = 41_f32 / 255_f32;
|
||||
let acc_alpha = 1_f32 - (1_f32 - layer_alpha).powf(n);
|
||||
let inv = 1_f32 - acc_alpha;
|
||||
Color::srgb(
|
||||
overlay_r * acc_alpha + inv,
|
||||
overlay_g * acc_alpha + inv,
|
||||
overlay_b * acc_alpha + inv,
|
||||
)
|
||||
}
|
||||
|
||||
fn is_tile_visible_at_z(tile_data: &FloorTileData, z_index: usize) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user