Skip to content

Commit

Permalink
ColorTransition: small fix backported from 291b181)
Browse files Browse the repository at this point in the history
  • Loading branch information
cahirwpz committed Dec 16, 2023
1 parent 8a33584 commit 7cc110d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/libgfx/ColorTransition.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ u_short ColorTransition(u_short from, u_short to, u_short step) {
short r = (from & 0xf00) | ((to >> 4) & 0x0f0) | step;
short g = ((from << 4) & 0xf00) | (to & 0x0f0) | step;
short b = ((from << 8) & 0xf00) | ((to << 4) & 0x0f0) | step;

return (colortab[r] << 4) | colortab[g] | (colortab[b] >> 4);

r = colortab[r];
g = colortab[g];
b = colortab[b];

return (r << 4) | g | (b >> 4);
}

0 comments on commit 7cc110d

Please sign in to comment.