Darken top based on absolute height

This commit is contained in:
Richard Zink committed 2026-10-06 18:10:38 +02:00
1 parent 6eac67af00
commit 7f6d74f9fd
1 file changed
+5 -1
+5 -1
View File
@@ -117,7 +117,11 @@
var top3 = project(wx + TILE - GAP/2, wy + GAP/2, h * HEIGHT_UNIT);
var top4 = project(wx + GAP/2, wy + GAP/2, h * HEIGHT_UNIT);
var topColor = '#5a8a5a';
var heightFactor = Math.min(1, Math.max(0, h / 15));
var topR = Math.floor(90 - heightFactor * 30);
var topG = Math.floor(138 - heightFactor * 30);
var topB = Math.floor(90 - heightFactor * 30);
var topColor = 'rgb(' + topR + ',' + topG + ',' + topB + ')';
var rightColor = '#6b4423';
var leftColor = '#3d2614';