Knight towers in bright limestone with dark blue shadows and royal blue wood and fittings (more contrast)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-03 20:03:32 +01:00
1 parent f359671dac
commit 90a05a86d8
1 file changed
+16 -2
+16 -2
View File
@@ -1304,6 +1304,20 @@ pub fn tower_height(t: &Tower) -> f32 {
t.top() t.top()
} }
// the colours of the knights' towers from the same model colours: brightness is stretched
// (strong contrast between masonry and joints), warm parts (wood, bronze) turn royal blue
fn knight_c(r: u8, g: u8, b: u8, f: f32) -> Color {
let l = ((r as f32 + g as f32 + b as f32) / (3.0 * 255.0) * 1.7).min(1.0);
let lerp = |a: f32, b: f32| a + (b - a) * l;
let warm = r as i32 - b as i32 > 30;
let (cr, cg, cb) = if warm {
(lerp(20.0, 70.0), lerp(30.0, 110.0), lerp(80.0, 230.0))
} else {
(lerp(28.0, 238.0), lerp(34.0, 232.0), lerp(72.0, 214.0))
};
Color::new(cr / 255.0 * f, cg / 255.0 * f, cb / 255.0 * f, 1.0)
}
fn shade_c(r: u8, g: u8, b: u8, f: f32) -> Color { fn shade_c(r: u8, g: u8, b: u8, f: f32) -> Color {
Color::new(r as f32 / 255.0 * f, g as f32 / 255.0 * f, b as f32 / 255.0 * f, 1.0) Color::new(r as f32 / 255.0 * f, g as f32 / 255.0 * f, b as f32 / 255.0 * f, 1.0)
} }
@@ -1349,8 +1363,8 @@ fn draw_towers_solid(g: &Game) {
let c = vec3(x, 0.0, z); let c = vec3(x, 0.0, z);
let h = tower_height(tw); let h = tower_height(tw);
let f = 0.75 + tw.flash * 1.5; // brightens briefly when firing let f = 0.75 + tw.flash * 1.5; // brightens briefly when firing
// knight towers: pale stone with blue tones // knight towers: bright limestone with dark blue shadows, wood and fittings in royal blue
let col = |r: u8, g: u8, b: u8| if tw.hero { shade_c(r / 3 + 110, g / 3 + 115, b / 3 + 135, f) } else { shade_c(r, g, b, f) }; let col = |r: u8, g: u8, b: u8| if tw.hero { knight_c(r, g, b, f) } else { shade_c(r, g, b, f) };
let bx = |p: Vec3, s: Vec3, cl: Color| draw_cube(c + p, s, None, cl); let bx = |p: Vec3, s: Vec3, cl: Color| draw_cube(c + p, s, None, cl);
match tw.kind { match tw.kind {
TowerKind::Arrow => { TowerKind::Arrow => {