Colours as data

I want to implement a colour catalogue (for paint selection, but this hardly matters). I have RGB (or any other colour space you like) in my spreadsheet; now I need to be able to use it to make a swatch in my application view. A few things would work, for example control of foreground/background for text elements, or a pseudo- image type that consists of just an RGB code (this latter seems more clunky, but leaves the door open for things like computed gradients, which would be a useful enhancement).
What I don’t want to have to do is make sixteen million pngs, or rely on an external image generator (although of course these exist, and could be used for prototyping).

3 Likes

Use Cloudinary! Find a white square image online, fetch it and then colorize it using a hex code.

Eg.

https://res.cloudinary.com/YOURUSERNAME/image/fetch/e_colorize,co_rgb:HEXCODE/LINKTOSQUAREIMAGE.png

For a formula, given that the hex codes are in Column A:

ARRAYFORMULA("https://res.cloudinary.com/YOURUSERNAME/image/fetch/e_colorize,co_rgb:"&A2:A&"/LINKTOSQUAREIMAGE.png")

1 Like