diff --git a/lib/libgfx/ColorTransition.c b/lib/libgfx/ColorTransition.c index 779719bd..82f9cb53 100644 --- a/lib/libgfx/ColorTransition.c +++ b/lib/libgfx/ColorTransition.c @@ -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); }