What the HEX?

“My color picker is picking the wrong hex code.”
“My hex codes are different than my eye dropper’s selection.”
“Each time I choose a color, the hex is slightly different.”

We’ve heard this many times from many users and have also experienced this ourselves. We feel your pain!

The short answer is...

Color spaces on the Mac are difficult to predict between multiple pieces of software, so use the manual hex codes as the fail safe.

You may see hex code differences between Contrast and your design tool, but this is often created by slightly different color space combinations and/or mathematical rounding differences between software.

However, if you're choosing both foreground and background colors with the color picker, the score will be correct, even if the hex codes are different than your design tool. Both colors will be rounded and chosen with the same algorithm, which will result in a correct WCAG score.

The longer answer can be summarized with this series of tweets, or by continuing to read below.

If a color space is set to sRGB then there is more of a possibility that the color picker will be closer to the actual intended hex code, but Apple’s framework for color is 8 bits per channel, which will quite often result in rounding errors of hex codes, even if they’re all in the same color space.

The rounding errors will be extremely hard to perceive with your eyes, but nonetheless there will be some odd wiggle room that comes from using one piece of software to select colors from another piece of software.

We are testing a future feature of Contrast that will allow you to set a color space within the settings, but it still has the same rounding error issues that you’ll see in other cross software, color picking solutions.

It will lessen the differences, but will not solve them completely as there is a deeper fundamental issue at play.

So now that you’re more informed of the color picking conundrum...

Use the hex codes from your design tool pasted into the manual inputs of Contrast for the most consistency.

If you'd like to continue your quest for color knowledge, this article is also helpful.

Download on the Mac App Store