18 return r1.
r == r2.
r && r1.
g == r2.
g && r1.
b == r2.
b;
44 if (v < (vmin + 0.25f * dv))
47 c.
g = 4 * (v - vmin) / dv;
50 else if (v < (vmin + 0.5f * dv))
54 c.
b = 1.0f + 4.0f * (vmin + 0.25f * dv - v) / dv;
56 else if (v < (vmin + 0.75f * dv))
58 c.
r = 4 * (v - vmin - 0.5f * dv) / dv;
64 c.
g = 1 + 4 * (vmin + 0.75f * dv - v) / dv;
69 c.
r = (v - vmin) / dv;
71 c.
b = (vmax - v) / dv;
74 c.
r = (v - vmin) / dv;
79 if (v < (vmin + dv / 6.0f)) {
81 c.
g = 6 * (v - vmin) / dv;
83 }
else if (v < (vmin + 2.0 * dv / 6.0f)) {
84 c.
r = 1 + 6 * (vmin + dv / 6.0f - v) / dv;
87 }
else if (v < (vmin + 3.0 * dv / 6.0f)) {
90 c.
b = 6 * (v - vmin - 2.0f * dv / 6.0f) / dv;
91 }
else if (v < (vmin + 4.0 * dv / 6.0f)) {
93 c.
g = 1 + 6 * (vmin + 3.0f * dv / 6.0f - v) / dv;
95 }
else if (v < (vmin + 5.0 * dv / 6.0f)) {
96 c.
r = 6 * (v - vmin - 4.0f * dv / 6.0f) / dv;
102 c.
b = 1 + 6 * (vmin + 5.0f * dv / 6.0f - v) / dv;
106 c.
r = (v - vmin) / (vmax - vmin);
111 c.
r = (v - vmin) / (vmax - vmin);
112 c.
g = (vmax - v) / (vmax - vmin);
116 if (v < (vmin + 0.25f * dv)) {
118 c.
g = 4 * (v - vmin) / dv;
120 }
else if (v < (vmin + 0.5f * dv)) {
121 c.
r = 4 * (v - vmin - 0.25f * dv) / dv;
124 }
else if (v < (vmin + 0.75f * dv)) {
125 c.
g = 4 * (v - vmin - 0.5f * dv) / dv;
130 c.
b = 4 * (v - vmin - 0.75f * dv) / dv;
135 if (v < (vmin + 0.5f * dv)) {
136 c.
r = 2 * (v - vmin) / dv;
140 c.
r = 1 - 2 * (v - vmin - 0.5f * dv) / dv;
146 if (v < (vmin + dv / 3)) {
147 c.
b = 3 * (v - vmin) / dv;
150 }
else if (v < (vmin + 2 * dv / 3)) {
152 c.
g = 3 * (v - vmin - dv / 3) / dv;
155 c.
r = 3 * (v - vmin - 2 * dv / 3) / dv;
161 if (v < (vmin + 0.2 * dv)) {
163 c.
g = 5 * (v - vmin) / dv;
165 }
else if (v < (vmin + 0.4 * dv)) {
168 c.
b = 1.f + 5.f * (vmin + 0.2f * dv - v) / dv;
169 }
else if (v < (vmin + 0.6 * dv)) {
170 c.
r = 5.f * (v - vmin - 0.4f * dv) / dv;
173 }
else if (v < (vmin + 0.8 * dv)) {
175 c.
g = 1 - 5 * (v - vmin - 0.6f * dv) / dv;
179 c.
g = 5.f * (v - vmin - 0.8f * dv) / dv;
180 c.
b = 5.f * (v - vmin - 0.8f * dv) / dv;
184 c1.
r = 200 / 255.0f; c1.
g = 60 / 255.0f; c1.
b = 0 / 255.0f;
185 c2.
r = 250 / 255.0f; c2.
g = 160 / 255.0f; c2.
b = 110 / 255.0f;
186 c.
r = (c2.
r - c1.
r) * (v - vmin) / dv + c1.
r;
187 c.
g = (c2.
g - c1.
g) * (v - vmin) / dv + c1.
g;
188 c.
b = (c2.
b - c1.
b) * (v - vmin) / dv + c1.
b;
191 c1.
r = 55 / 255.0f; c1.
g = 55 / 255.0f; c1.
b = 45 / 255.0f;
192 c2.
r = 200 / 255.0f; c2.
g = 60 / 255.0f; c2.
b = 0 / 255.0f;
194 c3.
r = 250 / 255.0f; c3.
g = 160 / 255.0f; c3.
b = 110 / 255.0f;
196 vmid = vmin + ratio * dv;
198 c.
r = (c2.
r - c1.
r) * (v - vmin) / (ratio*dv) + c1.
r;
199 c.
g = (c2.
g - c1.
g) * (v - vmin) / (ratio*dv) + c1.
g;
200 c.
b = (c2.
b - c1.
b) * (v - vmin) / (ratio*dv) + c1.
b;
202 c.
r = (c3.
r - c2.
r) * (v - vmid) / ((1-ratio)*dv) + c2.
r;
203 c.
g = (c3.
g - c2.
g) * (v - vmid) / ((1-ratio)*dv) + c2.
g;
204 c.
b = (c3.
b - c2.
b) * (v - vmid) / ((1-ratio)*dv) + c2.
b;
208 c1.
r = 0 / 255.0f; c1.
g = 255 / 255.0f; c1.
b = 0 / 255.0f;
209 c2.
r = 255 / 255.0f; c2.
g = 150 / 255.0f; c2.
b = 0 / 255.0f;
210 c3.
r = 255 / 255.0f; c3.
g = 250 / 255.0f; c3.
b = 240 / 255.0f;
212 vmid = vmin + ratio * dv;
214 c.
r = (c2.
r - c1.
r) * (v - vmin) / (ratio*dv) + c1.
r;
215 c.
g = (c2.
g - c1.
g) * (v - vmin) / (ratio*dv) + c1.
g;
216 c.
b = (c2.
b - c1.
b) * (v - vmin) / (ratio*dv) + c1.
b;
218 c.
r = (c3.
r - c2.
r) * (v - vmid) / ((1-ratio)*dv) + c2.
r;
219 c.
g = (c3.
g - c2.
g) * (v - vmid) / ((1-ratio)*dv) + c2.
g;
220 c.
b = (c3.
b - c2.
b) * (v - vmid) / ((1-ratio)*dv) + c2.
b;
225 c.
g = 1 - (v - vmin) / dv;
229 if (v < (vmin + 0.25f * dv)) {
231 c.
g = 4 * (v - vmin) / dv;
233 }
else if (v < (vmin + 0.5f * dv)) {
236 c.
b = 1 - 4 * (v - vmin - 0.25f * dv) / dv;
237 }
else if (v < (vmin + 0.75f * dv)) {
238 c.
r = 4 * (v - vmin - 0.5f * dv) / dv;
244 c.
b = 4 * (v - vmin - 0.75f * dv) / dv;
248 if (v < (vmin + 0.5f * dv)) {
250 c.
g = 2 * (v - vmin) / dv;
251 c.
b = 1 - 2 * (v - vmin) / dv;
253 c.
r = 2 * (v - vmin - 0.5f * dv) / dv;
254 c.
g = 1 - 2 * (v - vmin - 0.5f * dv) / dv;
259 if (v < (vmin + 0.5f * dv)) {
261 c.
g = 1 - 2 * (v - vmin) / dv;
262 c.
b = 2 * (v - vmin) / dv;
264 c.
r = 1 - 2 * (v - vmin - 0.5f * dv) / dv;
265 c.
g = 2 * (v - vmin - 0.5f * dv) / dv;
271 c.
g = (v - vmin) / (vmax - vmin);
275 c.
r = (v - vmin) / (vmax - vmin);
280 c1.
r = 0 / 255.0f; c1.
g = 160 / 255.0f; c1.
b = 0 / 255.0f;
281 c2.
r = 180 / 255.0f; c2.
g = 220 / 255.0f; c2.
b = 0 / 255.0f;
282 c3.
r = 250 / 255.0f; c3.
g = 220 / 255.0f; c3.
b = 170 / 255.0f;
284 vmid = vmin + ratio * dv;
286 c.
r = (c2.
r - c1.
r) * (v - vmin) / (ratio*dv) + c1.
r;
287 c.
g = (c2.
g - c1.
g) * (v - vmin) / (ratio*dv) + c1.
g;
288 c.
b = (c2.
b - c1.
b) * (v - vmin) / (ratio*dv) + c1.
b;
290 c.
r = (c3.
r - c2.
r) * (v - vmid) / ((1-ratio)*dv) + c2.
r;
291 c.
g = (c3.
g - c2.
g) * (v - vmid) / ((1-ratio)*dv) + c2.
g;
292 c.
b = (c3.
b - c2.
b) * (v - vmid) / ((1-ratio)*dv) + c2.
b;