WebGL-Fluid-Simulation icon indicating copy to clipboard operation
WebGL-Fluid-Simulation copied to clipboard

how we can change the shades color

Open jztlucky6264 opened this issue 3 years ago • 3 comments

jztlucky6264 avatar Nov 16 '22 04:11 jztlucky6264

您好,我已经收到你的信件!我会及时阅读并作出回应!

MiracleCK avatar Nov 16 '22 04:11 MiracleCK

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

whitelabtorino avatar May 25 '23 14:05 whitelabtorino