Usage (Android) import GetPixelColor from 'react-native-get-pixel-color' Īt this moment iOS implementation of this module is forked from. Usage (iOS) import GetPixelColor from 'react-native-get-pixel-color' ![]() In the near future both implementations would be unified to both use only one of these options. $ yarn add react-native-get-pixel-color Important noteįor iOS you should pass the path to the file, however for Android you should pass base64 string of the image. $ npm install react-native-get-pixel-color -save If that's not the problem, I tested this simple script side-by-side with Window Spy (the version distributed with AutoHotkey) and the color values always matched exactly.Get HEX color value from image in React Native. MouseMove, %X%, %Y%, 1 Restore the original positionĬlipboard = %clipboard%`nX%X% Y%Y% Color = %color% SetFormat, integer, hex Report it in hex so that you can see the blue-green-red compoents more easily. Sleep, 50 Might need time to make it reliable. ![]() Move the cursor out of the way so that it doesn't block the pixel we want. If you think that could be the problem, you could try a hotkey such as the following to retrieve the pixel color currently under the cursor: This tends to happen with non-standard cursors or in some types of games. It might have something to do with Window Spy misreporting the color due to the mouse cursor blocking the pixel you want.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |