chetstone / react-native-palette

A library wrapping the Android Palette class to extract colors from an image.
ISC License
73 stars 8 forks source link

Crash on android if user is in a locale that uses comma for decimal separator #13

Closed chetstone closed 5 years ago

chetstone commented 5 years ago

When converting android ARGB colors to rgba, java uses the locale setting for decimal separator, resulting in a corrupt rgba string, e.g: rgba(255,255,255,0,663), if the user is in a locale that uses comma for a decimal separator.

It should be rgba(255,255,255,0.663)

Javascript code that processes this value, expecting a valid rgba string, can crash.

chetstone commented 5 years ago

Fixed in commit 837090ce551f1e5e63e68b9ca219e9a2d9007ea0