Skip to content

Commit f6d448c

Browse files
committed
1.13: correct compare of TEMPERATURE_ZERO
1 parent 89b9149 commit f6d448c

File tree

2 files changed

+1054
-1054
lines changed

2 files changed

+1054
-1054
lines changed

src/colorramp.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,17 @@ interpolate_color(float temperature, float *c)
309309
if (temperature < TEMPERATURE_NORM)
310310
{
311311
c[0] = 1.0f;
312-
if (temperature < TEMPERATURE_ZERO)
313-
{
314-
c[1] = 0.0f;
315-
c[2] = 0.0f;
316-
}
317-
else
312+
if (temperature > TEMPERATURE_ZERO)
318313
{
319314
g = log(temperature - TEMPERATURE_ZERO);
320315
c[1] = floattrim(GAMMA_K0GR + GAMMA_K1GR * g, 0.0f, 1.0f);
321316
c[2] = floattrim(GAMMA_K0BR + GAMMA_K1BR * g, 0.0f, 1.0f);
322317
}
318+
else
319+
{
320+
c[1] = 0.0f;
321+
c[2] = 0.0f;
322+
}
323323
}
324324
else
325325
{

0 commit comments

Comments
 (0)