method of getting RGB/hex colour data from pixel in image?

Help

i’ve been working on a relatively simple shortcut that needs to find when a colour changes, and i can’t manage to get any sort of colour data from an image. is there a way of doing this (without uploading an image online, as this will be repeated)?

Posted Dec 27, 2019, 7:13 PM UTC

34
TuckyIA•

It’s (mostly) working! It’s not perfect, but this is the best I could do. I can’t figure out how to get the image to load in JavaScript in the Shortcuts parser, so it uses safari. Output is RBGW.

E: doesn’t use internet or load anything from the web. You can turn WiFi and cellular data off and it will still work.

3
Googolplexed06•

This seems to be what I need for my project! I need to determine the level of brightness (just greyscale, no color) of a 1x1 pixel “image” but I cannot seem to extract the provided RGB values from the final url to use in my own shortcut. Any suggestions?

1
SK4T3RG4M3R•

I’ve actually had this feature inside my shortcut, Chromakey. I didn’t actually make this particular part of the shortcut as I’m pretty clumsy with JavaScript, but maybe this will help you out a bit.

2
TuckyIA•

That’s a much more elegant (and significantly more functional) shortcut than what I tried to make, but I can’t find a single pixel option if the OP needs that. I wish JS wasn’t so weird in shortcuts and this problem would be much easier than it is (hence why browser works but not shortcut)

3
[deleted]•

[deleted]

1