Search

Recent Posts

Tags


« | Main | »

Creating A Custom Hot to Cold Temperature Color Gradient for use with RRDTool

By Dale Reagan | May 9, 2012

It seemed like a simple idea – write a script to generate a color gradient (hot to cold, i.e. Violet -> Red -> Orange -> Yellow -> Green -> Blue) that I could just ‘plugin’ and use. After spending some time with this the solution is simple a custom choice.  I found that some gradients ‘work’ when counting ‘down’ and other work when ‘counting up’…  If we assume that:

Then, you would think that it would be easy to locate such a chart – I did not find one in 2012 – so I created one…  (and note that this is really a matter of choice/preference – what makes sense to you is what you should use…)  This color gradient was combined with RRDTool graphing commands to create charts like this one:

System temperatures displaye with temperature color gradient

System temperatures display with temperature color gradient

See related posts for more RRDTool examples.   Before arriving at the temperature gradient table below I ran a number of ‘tests’ using simple count down/up loops incrementing values for RGB (Red, Green, Blue.)


Hot to Cold RED Temperature Gradient
Count Down/Hex/RGB Background Color: RGB | Hex
255 | red NC: ff_00_00 | 255,0,0 255,0,0 | ff0000
245 | red NC: f5_00_00 | 245,0,0 245,0,0 | f50000
235 | red NC: eb_00_00 | 235,0,0 235,0,0 | eb0000
225 | red NC: e1_00_00 | 225,0,0 225,0,0 | e10000
215 | red NC: d7_00_00 | 215,0,0 215,0,0 | d70000
205 | red NC: cd_00_00 | 205,0,0 205,0,0 | cd0000
195 | red NC: c3_00_00 | 195,0,0 195,0,0 | c30000
185 | red NC: b9_00_00 | 185,0,0 185,0,0 | b90000
175 | red NC: af_00_00 | 175,0,0 175,0,0 | af0000
165 | red NC: a5_00_00 | 165,0,0 165,0,0 | a50000
155 | red NC: 9b_00_00 | 155,0,0 155,0,0 | 9b0000
145 | red NC: 91_00_00 | 145,0,0 145,0,0 | 910000
135 | red NC: 87_00_00 | 135,0,0 135,0,0 | 870000
125 | red NC: 7d_00_00 | 125,0,0 125,0,0 | 7d0000
115 | red NC: 73_00_00 | 115,0,0 115,0,0 | 730000
105 | red NC: 69_00_00 | 105,0,0 105,0,0 | 690000
95 | red NC: 5f_00_00 | 95,0,0 95,0,0 | 5f0000
85 | red NC: 55_00_00 | 85,0,0 85,0,0 | 550000
Hot to Cold ORANGE Temperature Gradient

Count Down/Hex/RGB Background Color: RGB | Hex
0 | orange NC: FF_00_00 | 255,0,0 255,0,0 | FF0000
10 | orange NC: FF_0a_00 | 255,10,0 255,10,0 | FF0a00
20 | orange NC: FF_14_00 | 255,20,0 255,20,0 | FF1400
30 | orange NC: FF_1e_00 | 255,30,0 255,30,0 | FF1e00
40 | orange NC: FF_28_00 | 255,40,0 255,40,0 | FF2800
50 | orange NC: FF_32_00 | 255,50,0 255,50,0 | FF3200
60 | orange NC: FF_3c_00 | 255,60,0 255,60,0 | FF3c00
70 | orange NC: FF_46_00 | 255,70,0 255,70,0 | FF4600
80 | orange NC: FF_50_00 | 255,80,0 255,80,0 | FF5000
90 | orange NC: FF_5a_00 | 255,90,0 255,90,0 | FF5a00
100 | orange NC: FF_64_00 | 255,100,0 255,100,0 | FF6400
110 | orange NC: FF_6e_00 | 255,110,0 255,110,0 | FF6e00
120 | orange NC: FF_78_00 | 255,120,0 255,120,0 | FF7800
130 | orange NC: FF_82_00 | 255,130,0 255,130,0 | FF8200
140 | orange NC: FF_8c_00 | 255,140,0 255,140,0 | FF8c00
150 | orange NC: FF_96_00 | 255,150,0 255,150,0 | FF9600
160 | orange NC: FF_a0_00 | 255,160,0 255,160,0 | FFa000
170 | orange NC: FF_aa_00 | 255,170,0 255,170,0 | FFaa00
180 | orange NC: FF_b4_00 | 255,180,0 255,180,0 | FFb400
190 | orange NC: FF_be_00 | 255,190,0 255,190,0 | FFbe00
200 | orange NC: FF_c8_00 | 255,200,0 255,200,0 | FFc800
210 | orange NC: FF_d2_00 | 255,210,0 255,210,0 | FFd200
220 | orange NC: FF_dc_00 | 255,220,0 255,220,0 | FFdc00
230 | orange NC: FF_e6_00 | 255,230,0 255,230,0 | FFe600
240 | orange NC: FF_f0_00 | 255,240,0 255,240,0 | FFf000
250 | orange NC: FF_fa_00 | 255,250,0 255,250,0 | FFfa00

 


A Hot to Cold RGB Gradient for Temperatures

The table below is in use for Weather & Attic Temperature monitoring – You could easily expand or shrink the range of colors OR simply expand using a 2 or 3 degree ‘countdown’ (instead of ’1′ as shown’.)  A simple Bash script to display Gradient RGB/Hex values (rgb.gradient.sh)  for the chart below (TEXT output, now HTML…)

Hot to Cold Temperature Gradient | Violet -> Red -> Orange -> Yellow -> Green -> Blue

Count Down/Hex/RGB Background Color: RGB | Hex
90 | Temp: 190 | FF0EF0 | 255,14,240 255,14,240 | FF0EF0
89 | Temp: 188 | FF0DF0 | 255,13,240 255,13,240 | FF0DF0
88 | Temp: 186 | FF0CF0 | 255,12,240 255,12,240 | FF0CF0
87 | Temp: 184 | FF0BF0 | 255,11,240 255,11,240 | FF0BF0
86 | Temp: 182 | FF0AF0 | 255,10,240 255,10,240 | FF0AF0
85 | Temp: 180 | FF09F0 | 255,9,240 255,9,240 | FF09F0
84 | Temp: 178 | FF08F0 | 255,8,240 255,8,240 | FF08F0
83 | Temp: 176 | FF07F0 | 255,7,240 255,7,240 | FF07F0
82 | Temp: 174 | FF06F0 | 255,6,240 255,6,240 | FF06F0
81 | Temp: 172 | FF05F0 | 255,5,240 255,5,240 | FF05F0
80 | Temp: 170 | FF04F0 | 255,4,240 255,4,240 | FF04F0
79 | Temp: 168 | FF03F0 | 255,3,240 255,3,240 | FF03F0
78 | Temp: 166 | FF02F0 | 255,2,240 255,2,240 | FF02F0
77 | Temp: 164 | FF01F0 | 255,1,240 255,1,240 | FF01F0
76 | Temp: 162 | FF00F0 | 255,0,240 255,0,240 | FF00F0
75 | Temp: 160 | FF00E0 | 255,0,224 255,0,224 | FF00E0
74 | Temp: 158 | FF00D0 | 255,0,208 255,0,208 | FF00D0
73 | Temp: 156 | FF00C0 | 255,0,192 255,0,192 | FF00C0
72 | Temp: 154 | FF00B0 | 255,0,176 255,0,176 | FF00B0
71 | Temp: 152 | FF00A0 | 255,0,160 255,0,160 | FF00A0
70 | Temp: 150 | FF0090 | 255,0,144 255,0,144 | FF0090
69 | Temp: 148 | FF0080 | 255,0,128 255,0,128 | FF0080
68 | Temp: 146 | FF0070 | 255,0,112 255,0,112 | FF0070
67 | Temp: 144 | FF0060 | 255,0,96 255,0,96 | FF0060
66 | Temp: 142 | FF0050 | 255,0,80 255,0,80 | FF0050
65 | Temp: 140 | FF0040 | 255,0,64 255,0,64 | FF0040
64 | Temp: 138 | FF0030 | 255,0,48 255,0,48 | FF0030
63 | Temp: 136 | FF0020 | 255,0,32 255,0,32 | FF0020
62 | Temp: 134 | FF0010 | 255,0,16 255,0,16 | FF0010
61 | Temp: 132 | FF0000 | 255,0,0 255,0,0 | FF0000
60 | Temp: 130 | FF0a00 | 255,10,0 255,10,0 | FF0a00
59 | Temp: 128 | FF1400 | 255,20,0 255,20,0 | FF1400
58 | Temp: 126 | FF1e00 | 255,30,0 255,30,0 | FF1e00
57 | Temp: 124 | FF2800 | 255,40,0 255,40,0 | FF2800
56 | Temp: 122 | FF3200 | 255,50,0 255,50,0 | FF3200
55 | Temp: 120 | FF3c00 | 255,60,0 255,60,0 | FF3c00
54 | Temp: 118 | FF4600 | 255,70,0 255,70,0 | FF4600
53 | Temp: 116 | FF5000 | 255,80,0 255,80,0 | FF5000
52 | Temp: 114 | FF5a00 | 255,90,0 255,90,0 | FF5a00
51 | Temp: 112 | FF6400 | 255,100,0 255,100,0 | FF6400
50 | Temp: 110 | FF6e00 | 255,110,0 255,110,0 | FF6e00
49 | Temp: 108 | FF7800 | 255,120,0 255,120,0 | FF7800
48 | Temp: 106 | FF8200 | 255,130,0 255,130,0 | FF8200
47 | Temp: 104 | FF8c00 | 255,140,0 255,140,0 | FF8c00
46 | Temp: 102 | FF9600 | 255,150,0 255,150,0 | FF9600
45 | Temp: 100 | FFa000 | 255,160,0 255,160,0 | FFa000
44 | Temp: 98 | FFaa00 | 255,170,0 255,170,0 | FFaa00
43 | Temp: 96 | FFb400 | 255,180,0 255,180,0 | FFb400
42 | Temp: 94 | FFbe00 | 255,190,0 255,190,0 | FFbe00
41 | Temp: 92 | FFc800 | 255,200,0 255,200,0 | FFc800
40 | Temp: 90 | FFd200 | 255,210,0 255,210,0 | FFd200
39 | Temp: 88 | FFdc00 | 255,220,0 255,220,0 | FFdc00
38 | Temp: 86 | FFe600 | 255,230,0 255,230,0 | FFe600
37 | Temp: 84 | FFf000 | 255,240,0 255,240,0 | FFf000
36 | Temp: 82 | FFfa00 | 255,250,0 255,250,0 | FFfa00
35 | Temp: 80 | fdff00 | 253,255,0 253,255,0 | fdff00
34 | Temp: 78 | d7ff00 | 215,255,0 215,255,0 | d7ff00
33 | Temp: 76 | b0ff00 | 176,255,0 176,255,0 | b0ff00
32 | Temp: 74 | 8aff00 | 138,255,0 138,255,0 | 8aff00
31 | Temp: 72 | 65ff00 | 101,255,0 101,255,0 | 65ff00
30 | Temp: 70 | 3eff00 | 62,255,0 62,255,0 | 3eff00
29 | Temp: 68 | 17ff00 | 23,255,0 23,255,0 | 17ff00
28 | Temp: 66 | 00ff10 | 0,255,16 0,255,16 | 00ff10
27 | Temp: 64 | 00ff36 | 0,255,54 0,255,54 | 00ff36
26 | Temp: 62 | 00ff5c | 0,255,92 0,255,92 | 00ff5c
25 | Temp: 60 | 00ff83 | 0,255,131 0,255,131 | 00ff83
24 | Temp: 58 | 00ffa8 | 0,255,168 0,255,168 | 00ffa8
23 | Temp: 56 | 00ffd0 | 0,255,208 0,255,208 | 00ffd0
22 | Temp: 54 | 00fff4 | 0,255,244 0,255,244 | 00fff4
21 | Temp: 52 | 00e4ff | 0,228,255 0,228,255 | 00e4ff
20 | Temp: 50 | 00d4ff | 0,212,255 0,212,255 | 00d4ff
19 | Temp: 48 | 00c4ff | 0,196,255 0,196,255 | 00c4ff
18 | Temp: 46 | 00b4ff | 0,180,255 0,180,255 | 00b4ff
17 | Temp: 44 | 00a4ff | 0,164,255 0,164,255 | 00a4ff
16 | Temp: 42 | 0094ff | 0,148,255 0,148,255 | 0094ff
15 | Temp: 40 | 0084ff | 0,132,255 0,132,255 | 0084ff
14 | Temp: 38 | 0074ff | 0,116,255 0,116,255 | 0074ff
13 | Temp: 36 | 0064ff | 0,100,255 0,100,255 | 0064ff
12 | Temp: 34 | 0054ff | 0,84,255 0,84,255 | 0054ff
11 | Temp: 32 | 0044ff | 0,68,255 0,68,255 | 0044ff
10 | Temp: 30 | 0032ff | 0,50,255 0,50,255 | 0032ff
9 | Temp: 28 | 0022ff | 0,34,255 0,34,255 | 0022ff
8 | Temp: 26 | 0012ff | 0,18,255 0,18,255 | 0012ff
7 | Temp: 24 | 0002ff | 0,2,255 0,2,255 | 0002ff
6 | Temp: 22 | 0000ff | 0,0,255 0,0,255 | 0000ff
5 | Temp: 20 | 0100ff | 1,0,255 1,0,255 | 0100ff
4 | Temp: 18 | 0200ff | 2,0,255 2,0,255 | 0200ff
3 | Temp: 16 | 0300ff | 3,0,255 3,0,255 | 0300ff
2 | Temp: 14 | 0400ff | 4,0,255 4,0,255 | 0400ff
1 | Temp: 12 | 0500ff | 5,0,255 5,0,255 | 0500ff

RRDTool Temperature Gradient Graph useing color codes from the preceding table.

RRDTool Temperature Gradient - Zone X - Roof.

RRDTool Temperature Gradient - Zone X - Roof.

Of course, your gradients should vary, at least a little bit… :)

Topics: Computer Technology, Web Technologies | Comments Off

Comments are closed.


________________________________________________
YOUR GeoIP Data | Ip: 54.81.80.156
Continent: NA | Country Code: US | Country Name: United States
Region: WA | State/Region Name: Washington | City: Seattle
(US only) Area Code: 206 | Postal code/Zip: 98109
Latitude: 47.634399 | Longitude: -122.342201
Note - if using a mobile device your physical location may NOT be accurate...
________________________________________________

Georgia-USA.Com - Web Hosting for Business
____________________________________