Darken top based on absolute height
This commit is contained in:
1 parent
6eac67af00
commit
7f6d74f9fd
1 file changed
+5
-1
+5
-1
@@ -117,7 +117,11 @@
|
|||||||
var top3 = project(wx + TILE - GAP/2, wy + GAP/2, h * HEIGHT_UNIT);
|
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 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 rightColor = '#6b4423';
|
||||||
var leftColor = '#3d2614';
|
var leftColor = '#3d2614';
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user