Can someone please help me understand what this valueToColor does?(https://github.com/Rylern/InterpolateHeatmapLayer)
vec3 valueToColor(float value) {
return vec3(max((value-0.5)*2.0, 0.0), 1.0 - 2.0*abs(value - 0.5), max((0.5-value)*2.0, 0.0));
}
I am trying create this color scheme but I am not used to using vec3. The goal
is to set the color something like this.
How can this be done in javascript?
Documentation for the valueToColor.