Skip to content

Commit

Permalink
1.3: correct compare of TEMPERATURE_ZERO
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Dec 14, 2022
1 parent 89b9149 commit c2d4b24
Show file tree
Hide file tree
Showing 2 changed files with 1,054 additions and 1,054 deletions.
12 changes: 6 additions & 6 deletions src/colorramp.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,17 +309,17 @@ interpolate_color(float temperature, float *c)
if (temperature < TEMPERATURE_NORM)
{
c[0] = 1.0f;
if (temperature < TEMPERATURE_ZERO)
{
c[1] = 0.0f;
c[2] = 0.0f;
}
else
if (temperature > TEMPERATURE_ZERO)
{
g = log(temperature - TEMPERATURE_ZERO);
c[1] = floattrim(GAMMA_K0GR + GAMMA_K1GR * g, 0.0f, 1.0f);
c[2] = floattrim(GAMMA_K0BR + GAMMA_K1BR * g, 0.0f, 1.0f);
}
else
{
c[1] = 0.0f;
c[2] = 0.0f;
}
}
else
{
Expand Down
Loading

0 comments on commit c2d4b24

Please sign in to comment.