react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Colors][Android] Using fractional rgb values causes an error

Open ide opened this issue 11 years ago • 5 comments

When you use Animated to animate from one color to another, it creates rgb() strings with fractional values. The Java side assumes the rgb values are always ints and calls Integer.parseInt on them -- which leads to a fatal when decimals are passed in. After thinking about the problem a bit, I think the right solution is for the native layer to be more robust and parseFloats that are then rounded at the last moment.

ide avatar Sep 14 '15 18:09 ide

We're changing the way color processing is done, and it will fix this issue along the way.

andreicoman11 avatar Sep 14 '15 21:09 andreicoman11

If you're working on this, it seems like "rgba(0, 0, 0, 0.155)" works but "rgba(0, 0, 0, 0.1554)" doesn't (4 digits). I'm not sure if it's even worth supporting though.

bsansouci avatar Sep 16 '15 16:09 bsansouci

Until this is fixed, Is there another way to animate colours using react[android]?

cmrichards avatar Sep 17 '15 08:09 cmrichards

@ide is this still a problem? I think color processing moved to js.

chirag04 avatar Nov 26 '15 15:11 chirag04

Haven't seen this problem with animated recently.

ide avatar Nov 26 '15 18:11 ide