👴🎷 Checkpoint

./public/index.js:1954897/23821
This commit is contained in:
Glitch (glitch-hello-node) committed 2021-11-14 16:48:56 +00:00
1 parent 3869d19029
commit d13262ec4b
2 files changed
+52 -1

No files matched your search

+3 -1
View File
@@ -86,10 +86,12 @@ async function drawRegions() {
const min = Math.min(...data.map(d => d.count))
const max = Math.max(...data.map(d => d.count))
if (max == min) return
const red = new Color(255, 0, 0)
const green = new Color(0, 255, 0)
console.log({current, max, min})
const color = red.interpolate(green, -current / (max - min))
const color = green.interpolate(red, (current - min) / (max - min))
buildings.ECSW.poly.setStyle({ color: color.asRgbCss() })
console.log({avg, current, delta, color})