The
classic colormap of fire (and that of
black body radiation too) is
a very simple function within the
RGB world.
fire R G B
0 0 0 0
1 3 0 0
2 6 0 0
. . . .
84 252 0 0
85 255 0 0
86 255 3 0
. . . .
169 255 252 0
170 255 255 0
171 255 255 3
. . . .
254 255 255 252
255 255 255 255
The function (in pseudo code - translate to your favorite language as
desired):
fire(intensity {range: 0 - 255})
R = min(intensity,85) * 3
intensity = max(intensity-85,0)
G = min(intensity,85) * 3
intensity = max(intensity-85,0)
B = min(intensity,85) * 3
return (R,G,B)
This colormap ranges in intensity from black through dark red, to
orange and yellow and eventually to a bright white.
Realize that one 'feature' of this color map is that it has exactly
256 colors, which is the maximum number allowed by the .gif file format.
If you desire to make a flame (render, draw, animate) in a .gif, this
colormap will serve you well.
Of interest - the following html colors closely match a color above:
fire R G B | color R G B | dR dG dB
0 0 0 0 | BLACK 0 0 0 | 0 0 0
85 255 0 0 | RED 255 0 0 | 0 0 0
108 255 69 0 | ORAGERED 255 69 0 | 0 0 0
127 255 126 0 | darkorange1 255 127 0 | 0 -1 0
132 255 141 0 | DARKORANGE 255 140 0 | 0 +1 0
140 255 165 0 | ORANGE 255 165 0 | 0 0 0
157 255 216 0 | GOLD 255 215 0 | 0 +1 0
170 255 255 0 | YELLOW 255 255 0 | 0 0 0
245 255 255 225 | LIGHTYELLOW 255 255 224 | 0 +1 0
250 255 255 240 | IVORY 255 255 240 | 0 0 0
255 255 255 255 | WHITE 255 255 255 | 0 0 0
(standard
html colors are in
CAPS)