These colors are created by (first) drawing them into a texture using ftDrawForce and (second) adding this texture to the density of the fluid sim. (line 221:)
fluid.addDensity(flexDrawForces[i].getTextureReference(), strength);
The ftDrawForce has a setForce(ofVec4f(0,0,0,0)) method that sets a the force. If the ftDrawForceType is FT_DENSITY the setforce will behave more or less as ofFloatColor, where x,y,z,w translate to r,g,b,a
You can change this force in the gui of the example, go to:
-
mouse left button
x = red
y = green
z = blue
w = alpha
You can also change the type of the force here
non/den/vel/tem/prs/ob:
non = no force
den = density (color)
vel = velocity
tem = temperature
ob = obstacle
Each mouse button has multiple forces connected to it of which the first is in high resolution (draw full res) for use with density (which in this simulation translates to color).
The other two are in the resolution of the simulation (usually a quarter of the full resolution).