From vektorboson's drop tutorial (which can be found in the editors depot)
Drop [ShapeName, AnimationName, Type, TimerPeriod, LifeTime, Position, MoveVelocity, RotationVelocity, Weight, Volume, Rubbing, Size, Color, AnimationPhase, RandomDirectionPeriod, RandomDirectionIntensity, OnTimer, BeforeDestroy, Object]
Color | particle color (transition) | Array
We want first red, then green and last but not least blue.
color = [ [1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 1] ]
Yellow is a mix-up of red and green, so yellow=[1, 1, 0, 1] and black [0, 0, 0, 1] and white [1, 1, 1, 1].
So our color format is (like everywhere else in OFP): [RED, GREEN, BLUE, ALPHA]
Alpha is opacity or transparency. 1 is fully opaque, while 0 means full transparency (invisible)!
So you see no math required
Here's also a line of the drop command in action.
drop ["cl_fire", "", "Billboard", _lifetime, _lifetime, [_x, _y, 0.2], _vel, 0, 0.2, 0.157, 0.001, _size, _color,
The drop command has lots of parameters you can use, but don't be confused about it.
Every drop script 'pre-defines' the values of those parameters before executing the actual drop command. ^ up there some parameters defined earlier in the script are '_lifetime', '_x', '_y', '_size' and '_color'
here's an example of defining the color array
_color = [[0.4,0.4,0.4,0],[0.6,0.6,0.6,1],[0.7,0.7,0.65,1], [0.65, 0.6, 0.5, 0]]