CamiloGarciaLaRotta/w3-weather

Change color of particles depending on temperature

Closed this issue · 0 comments

The temperature value is already available at rendering time.
Just need to create a smooth gradient for [-30,30] degrees from dark blue to bright orange

Currently, the values are hardcoded:

// draw.js
let color = '';
if (this.T <= -5) color = 'rgb(105, 73, 255)';
else if (this.T <= 5) color = 'rgb(22, 176, 221)';
else if (this.T <= 15) color = 'rgb(255, 178, 0)';
else color = 'rgb(242, 114, 66)';