i set your question up in photoshop screenshots, but your information raises more questions for what you left out like 1) what profile you have your illustrator working rgb set to (it should be srgb if you are setting hex colors), and 2) at what point your hex colors are changing (in the swatch itself, in the object, or in the saved document (.jpg?)
the short answer is not all hex colors can 'fit' exactly inside the sRGB colorspace (or is it the .jpg format) -- you might try saving as .png and checking the values in photoshop (apply the sRGB source profile when you open them) -- try google hex colors change .jpg vs .png (this has come up here before)
My screenshots show i set the hex values that match your rgb numbers (in .psd) -- however when i save for web (.jpg) the numbers shift slightly -- if you are using .jpg as as a destination format, you need to pick a hex color that translates exactly to that format
Hello! First of all, BIG THANK YOU for taking the time to explain this so thoroughly! I continued to research the issue and found that the gamut warning was going to cause me problems when we decided to go to print (CMYK) for business cards, etc.
I spoke with my client and asked him to be flexible on the colour and he agreed. I went with a slightly different green that didn't cause the warning to appear but was still clsoe to a fresh, bright green. But not to lime/bright.
To answer your question, I set up the colour profile as RGB (but not hex - I looked up the RGB using a hex colour converter) and just set the colour up that way.
To answer your second question, when did it change - when I set up the swatch or when I saved to JPEG. It would change with the swatch.
Your time and very clear answers are so very helpful. Thank you very much. Although I did change the colours, I've learned something about hex and RGB and I so appreciate you sharing your expertise.
All the best.
I set up the colour profile as RGB (but not hex - I looked up the RGB using a hex colour converter) and just set the colour up that way.
Before going any further, you need to understand that a given color value - RGB or hex - is undefined until a specific color space is assigned. The color space is what gives the numbers meaning.
Hex 09D404 is one color in sRGB, quite another color in Adobe RGB, and so on. And vice versa - a certain color will produce very different numbers in sRGB and Adobe RGB.
A lot of people mistakenly believe hexadecimal notation represents absolute colors. It doesn't. Hex is actually outdated and obsolete, a relic from a time before modern color management. It only makes sense as long as you specifically refer to sRGB.
According to your original post you're working in Illustrator.
1. You can use RGB swatches (Process RGB) unchanged, if your document color is RGB.
If your Document color is CMYK then an RGB color is converted immediatedly into CMYK
and from there back to RGB, if you read the swatch RGB numbers. This results in a severe
change if the color is out-of-gamut for CMYK. Most likely for your green!
2. Now let's asasume that your document color is any RGB. The RGB numbers are to be
considered as fixed, but the appearance depends on the RGB space (sRGB, AdobeRGB,
ProPhotoRGB), as already explained.
3. Hex-Numbers (h) mean exactly the same as RGB decimal numbers (d) – simply numbers:
0...9 (h) = 0...9 (d)
A B C D E F (h) = 10 11 12 13 14 15 (d)
The weights for the two digits in e.g. D4 are 16 and 1.
09 D4 04(h) = 0*16+9*1 / 13*16+4*1 / 0*16+4*1 (d) = 9 / 212 / 4 (d)
Thus, hex is just a very uncomfortable notation, exept for programming in assembly language .
4. Don't ever use so-called Web-safe colors. These are a small subset (only 216 colors)
of 16.7 millions of colors as available by R,G,B in the range 0...255 each. The full set is safe
anywhere, if the channels R,G,B are represented by one byte each.
Best regards --Gernot Hoffmann