Skip to content

Commit

Permalink
Fixed transparent colors in interpolateColors (software-mansion#2354)
Browse files Browse the repository at this point in the history
## Description
When one of the colors in the output range was transparent, interpolateColors doesn't work, due to a wrong undefined check.

Fixes software-mansion#2328 

## Changes
- Changed to explicit check if color is undefined, to prevent issue when color value is 0
  • Loading branch information
jmysliv authored Sep 1, 2021
1 parent f88940c commit 84ede66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/reanimated2/Colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ const getInterpolateCacheRGBA = (
for (let i = 0; i < colors.length; ++i) {
const color = colors[i];
const proocessedColor = processColor(color);
if (proocessedColor) {
// explicit check in case if processedColor is 0
if (proocessedColor !== null && proocessedColor !== undefined) {
r.push(red(proocessedColor));
g.push(green(proocessedColor));
b.push(blue(proocessedColor));
Expand Down

0 comments on commit 84ede66

Please sign in to comment.