osamaqarem/react-native-image-colors

Getting different color in both platform

Closed this issue · 1 comments

Hi, thanks for this awesome library, I am using this in one of my react native projects. But my client wants me to get the same exact color for IOS and Android as well, but this library gives different color for the same image. what should I do?

This library is a wrapper around the Palette class on Android and UIImageColors on iOS. So because they have different implementation, they can extract different colors for the same image.

There isn't anything you can do. you could tinker with the colors extracted for some image and see which properties are closest to each other in iOS and Android.

you can check if node-vibrant works with react native since its implemented in JS and will get the same colors for both platforms.