Shopify / react-native-skia

High-performance React Native Graphics using Skia

Home Page:https://shopify.github.io/react-native-skia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Skia does not render negative Android color integers

peterlazar1993 opened this issue ยท comments

Description

I am animating a linear gradient using the interpolateColor function from reanimated.
It outputs signed integers on Android and unsigned integers on iOS.

This means that on Android there are negative integers and Skia is unable to render this.
In the reproduction link I provided, I have added colors with opacity 0.4 (produces positive integers) and 1 color with opacity 1 (produces negative values). You can see that the gradient suddenly goes transparent.

Version

0.1.221, 1.0.4

Steps to reproduce

  • Setup a linear gradient with opaque colors
  • Change the colors value to be generated by interpolateColor function from reanimated

Snack, code example, screenshot, or link to a repository

https://snack.expo.dev/@peter1993/0ec6cf

Thanks a lot that's a nice catch, you can use interpolateColors from react-native-skia instead. I documented the issue at #2331. I hope this helps, let me know if you have any questions.

๐ŸŽ‰ This issue has been resolved in version 1.1.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€