//Shadow palette for coloring the roofs //color pallet white->black var shadowPalette = ['#ffffff','#f0f0f0','#d9d9d9','#bdbdbd','#969696','#737373','#525252','#252525']; //const shadowPalette = colorPalette.reverse(); //returns the responding color from the shadowPalette, depending on the inputShadowValue(0 to 1 in float) function getShadowPalette(inputShadowValue){ //TODO: add check for wrong inputShadowValues //checking for the float values if(!Number.isInteger(inputShadowValue)){ var index = Math.ceil((shadowPalette.length-1)*inputShadowValue); //console.log(shadowPalette[index]); return shadowPalette[index]; } //edge case for 0 and 1 else{ //console.log("black",shadowPalette[shadowPalette.length-1]); return shadowPalette[shadowPalette.length-1]; } }