At first, I was using the hexagonal color-cube in WORD to create gradients, but that didn't have the resolution nor flexibility that I wanted. This PHP app takes 3 input parameters: beginning color, ending color, and the number of steps requested and interpolates between them. Step 0 is always the beginning color, and step n is the ending color.

theory of operation

The beginning and ending colors are captured from the GET request to the server. After range checking of the colors and the number of steps requested, a loop is run and the RGB components are linearly interpolated according to the current step of the loop. The color generated is used as the background of the table row.

The color values are provided on each row in both decimal and hexadecimal. The ordering for the values in black text are: index number, percentage of interpolation, decimal value of the background color, hexadecimal value of the background color. The ordering of the white text is a mirror of the ordering of the black text. Obviously, the black and white provide enough redundancy so that at least one set of values is readable (having high enough contrast with the background to be read) no matter what begin and end colors are chosen.

Source code for the color gradient generator may be found here. It's a PHP file, but it has a .txt final extension to make it easier to download from the web server. A final caveat: the html, head, and body tags are not included in this file. The file was meant to be included into a host document. In fact, this document hosts the source file directly with a PHP include.

usage

Provide values for color begin, color end, and number of steps, and click on the 'generate color gradient' button.

variable: number type minimum maximum value
color begin: hex 0x000000 0xFFFFFF
color end: hex 0x000000 0xFFFFFF
number of steps: dec 1 255

values are: (color begin: 0xF11919), (color end: 0xFF8A00), (number of steps: 175)

00%15800601F11919F11919158006010%0
10%15800600F11918F11918158006000%1
21%15800856F11A18F11A18158008561%2
31%15800856F11A18F11A18158008561%3
42%15801112F11B18F11B18158011122%4
52%15801368F11C18F11C18158013682%5
63%15801368F11C18F11C18158013683%6
74%15801624F11D18F11D18158016244%7
84%15801879F11E17F11E17158018794%8
95%15801879F11E17F11E17158018795%9
105%15802135F11F17F11F17158021355%10
116%15802391F12017F12017158023916%11
126%15802391F12017F12017158023916%12
137%15868183F22117F22117158681837%13
148%15868439F22217F22217158684398%14
158%15868438F22216F22216158684388%15
169%15868694F22316F22316158686949%16
179%15868694F22316F22316158686949%17
1810%15868950F22416F224161586895010%18
1910%15869206F22516F225161586920610%19
2011%15869206F22516F225161586920611%20
2112%15869462F22616F226161586946212%21
2212%15869717F22715F227151586971712%22
2313%15869717F22715F227151586971713%23
2413%15869973F22815F228151586997313%24
2514%15935765F32915F329151593576514%25
2614%15935765F32915F329151593576514%26
2715%15936021F32A15F32A151593602115%27
2816%15936277F32B15F32B151593627716%28
2916%15936276F32B14F32B141593627616%29
3017%15936532F32C14F32C141593653217%30
3117%15936788F32D14F32D141593678817%31
3218%15936788F32D14F32D141593678818%32
3318%15937044F32E14F32E141593704418%33
3419%15937044F32E14F32E141593704419%34
3520%15937300F32F14F32F141593730020%35
3620%15937555F33013F330131593755520%36
3721%15937555F33013F330131593755521%37
3821%16003347F43113F431131600334721%38
3922%16003603F43213F432131600360322%39
4022%16003603F43213F432131600360322%40
4123%16003859F43313F433131600385923%41
4224%16004115F43413F434131600411524%42
4324%16004114F43412F434121600411424%43
4425%16004370F43512F435121600437025%44
4525%16004626F43612F436121600462625%45
4626%16004626F43612F436121600462626%46
4726%16004882F43712F437121600488226%47
4827%16004882F43712F437121600488227%48
4928%16005138F43812F438121600513828%49
5028%16070929F53911F539111607092928%50
5129%16070929F53911F539111607092929%51
5229%16071185F53A11F53A111607118529%52
5330%16071441F53B11F53B111607144130%53
5430%16071441F53B11F53B111607144130%54
5531%16071697F53C11F53C111607169731%55
5632%16071953F53D11F53D111607195332%56
5732%16071952F53D10F53D101607195232%57
5833%16072208F53E10F53E101607220833%58
5933%16072464F53F10F53F101607246433%59
6034%16072464F53F10F53F101607246434%60
6134%16072720F54010F540101607272034%61
6235%16072976F54110F541101607297635%62
6336%16138512F64110F641101613851236%63
6436%16138767F6420FF6420F1613876736%64
6537%16138767F6420FF6420F1613876737%65
6637%16139023F6430FF6430F1613902337%66
6738%16139279F6440FF6440F1613927938%67
6838%16139279F6440FF6440F1613927938%68
6939%16139535F6450FF6450F1613953539%69
7040%16139791F6460FF6460F1613979140%70
7140%16139790F6460EF6460E1613979040%71
7241%16140046F6470EF6470E1614004641%72
7341%16140302F6480EF6480E1614030241%73
7442%16140302F6480EF6480E1614030242%74
7542%16206094F7490EF7490E1620609442%75
7643%16206350F74A0EF74A0E1620635043%76
7744%16206350F74A0EF74A0E1620635044%77
7844%16206605F74B0DF74B0D1620660544%78
7945%16206861F74C0DF74C0D1620686145%79
8045%16206861F74C0DF74C0D1620686145%80
8146%16207117F74D0DF74D0D1620711746%81
8246%16207117F74D0DF74D0D1620711746%82
8347%16207373F74E0DF74E0D1620737347%83
8448%16207629F74F0DF74F0D1620762948%84
8548%16207628F74F0CF74F0C1620762848%85
8649%16207884F7500CF7500C1620788449%86
8749%16208140F7510CF7510C1620814049%87
8850%16273676F8510CF8510C1627367650%88
8950%16273932F8520CF8520C1627393250%89
9051%16274188F8530CF8530C1627418851%90
9152%16274188F8530CF8530C1627418852%91
9252%16274443F8540BF8540B1627444352%92
9353%16274699F8550BF8550B1627469953%93
9453%16274699F8550BF8550B1627469953%94
9554%16274955F8560BF8560B1627495554%95
9654%16274955F8560BF8560B1627495554%96
9755%16275211F8570BF8570B1627521155%97
9856%16275466F8580AF8580A1627546656%98
9956%16275466F8580AF8580A1627546656%99
10057%16341258F9590AF9590A1634125857%100
10157%16341514F95A0AF95A0A1634151457%101
10258%16341514F95A0AF95A0A1634151458%102
10358%16341770F95B0AF95B0A1634177058%103
10459%16342026F95C0AF95C0A1634202659%104
10560%16342026F95C0AF95C0A1634202660%105
10660%16342281F95D09F95D091634228160%106
10761%16342537F95E09F95E091634253761%107
10861%16342537F95E09F95E091634253761%108
10962%16342793F95F09F95F091634279362%109
11062%16343049F96009F960091634304962%110
11163%16343049F96009F960091634304963%111
11264%16343305F96109F961091634330564%112
11364%16408840FA6108FA61081640884064%113
11465%16409096FA6208FA62081640909665%114
11565%16409352FA6308FA63081640935265%115
11666%16409352FA6308FA63081640935266%116
11766%16409608FA6408FA64081640960866%117
11867%16409864FA6508FA65081640986467%118
11968%16409863FA6507FA65071640986368%119
12068%16410119FA6607FA66071641011968%120
12169%16410375FA6707FA67071641037569%121
12269%16410375FA6707FA67071641037569%122
12370%16410631FA6807FA68071641063170%123
12470%16410887FA6907FA69071641088770%124
12571%16476423FB6907FB69071647642371%125
12672%16476679FB6A07FB6A071647667972%126
12772%16476934FB6B06FB6B061647693472%127
12873%16476934FB6B06FB6B061647693473%128
12973%16477190FB6C06FB6C061647719073%129
13074%16477190FB6C06FB6C061647719074%130
13174%16477446FB6D06FB6D061647744674%131
13275%16477702FB6E06FB6E061647770275%132
13376%16477702FB6E06FB6E061647770276%133
13476%16477957FB6F05FB6F051647795776%134
13577%16478213FB7005FB70051647821377%135
13677%16478213FB7005FB70051647821377%136
13778%16478469FB7105FB71051647846978%137
13878%16544261FC7205FC72051654426178%138
13979%16544261FC7205FC72051654426179%139
14080%16544516FC7304FC73041654451680%140
14180%16544772FC7404FC74041654477280%141
14281%16544772FC7404FC74041654477281%142
14381%16545028FC7504FC75041654502881%143
14482%16545028FC7504FC75041654502882%144
14582%16545284FC7604FC76041654528482%145
14683%16545540FC7704FC77041654554083%146
14784%16545540FC7704FC77041654554084%147
14884%16545795FC7803FC78031654579584%148
14985%16546051FC7903FC79031654605185%149
15085%16611587FD7903FD79031661158785%150
15186%16611843FD7A03FD7A031661184386%151
15286%16612099FD7B03FD7B031661209986%152
15387%16612099FD7B03FD7B031661209987%153
15488%16612355FD7C03FD7C031661235588%154
15588%16612610FD7D02FD7D021661261088%155
15689%16612610FD7D02FD7D021661261089%156
15789%16612866FD7E02FD7E021661286689%157
15890%16613122FD7F02FD7F021661312290%158
15990%16613122FD7F02FD7F021661312290%159
16091%16613378FD8002FD80021661337891%160
16192%16613377FD8001FD80011661337792%161
16292%16613633FD8101FD81011661363392%162
16393%16679425FE8201FE82011667942593%163
16493%16679425FE8201FE82011667942593%164
16594%16679681FE8301FE83011667968194%165
16694%16679937FE8401FE84011667993794%166
16795%16679937FE8401FE84011667993795%167
16896%16680193FE8501FE85011668019396%168
16996%16680448FE8600FE86001668044896%169
17097%16680448FE8600FE86001668044897%170
17197%16680704FE8700FE87001668070497%171
17298%16680960FE8800FE88001668096098%172
17398%16680960FE8800FE88001668096098%173
17499%16681216FE8900FE89001668121699%174
175100%16747008FF8A00FF8A0016747008100%175

Privacy Policy