PavelDoGreat/WebGL-Fluid-Simulation

how we can change the shades color

jztlucky6264 opened this issue · 2 comments

how we can change the shades color

In this part of the code (line 1565)
function generateColor () { let c = HSVtoRGB(Math.random(), 1.0, 1.0); c.r *= 0.15; c.g *= 0.15; c.b *= 0.15; return c; }
you have to change the values at MathRandom.
For example:
function generateColor() { // For shades of blue and cyan, you should set the hue around 0.5-0.66 let hue = Math.random() * 0.16 + 0.5; // This generates a random number between 0.5 and 0.66 let c = HSVtoRGB(hue, 1.0, 1.0) c.r *= 0.15 c.g *= 0.15 c.b *= 0.15 return c }.
This way, your code will only generate shades of blue. If you want the blue to be more intense, you might consider removing or reducing the reduction for the value of c.b