...and isn't as critical as you may think.
If this is for a website then you have to take into consideration that the end user probably will not be viewing this on a colour calibrated device.
Furthermore, each 'browser' used may not have its colour space set correctly....I mean who does that unless you know about it?
I wouldn't be too particular about getting colours absolutely spot on.....the chances of anyone ever seeing them as you intended is minimal.
You would probably be better off just having the colours in a swatch instead of trying to apply them to an image.
I know that's not the ideal but its simple, practical, it works, and if people don't have the intelligence to understand there may be slight colour difference in the what they see and what they get, then it only takes a small declaration to be added to the page in plain text to the fact.
(Look at a well known auction site....you'll see this declaration everywhere!)
You could still do this if you go ahead with the complex image idea but I wouldn't waste time trying to get it exact....as close as possible would be more than adequate.
Use your time efficiently.
Just my 2¢.
Regards.
MrToM.