Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jab/e954665164de6b65543496cbe6182a6f to your computer and use it in GitHub Desktop.
Save jab/e954665164de6b65543496cbe6182a6f to your computer and use it in GitHub Desktop.

Update

Just use https://github.com/ripeworks/iro which gets the challenge below right!

Mac Color Picking Done Right

Picking a Color on Mac is hard. Mainly due to the fact that several applications floating around the web ( AppStore and independant ), grab the color "incorrectly".

Why incorrectly?

The color picker is not picking the "real" color, but rather, it's picking the color that your screen is displaying, what do I mean?

Lets try to grab the following color:

Real Hex Color: #2C3E50

xScope Loupe: #2D3E4F

Mac's Color Picker: #2D3E4F

ColorChooser: #2D3E4F

The colors are very similar, but without doubt there is a color shift.

Why does it happen? Well, it has to do with the color space assigned to your display. If you have multiple external displays you're going to even see shifts between your displays, completely screwing up colors gradually.

How do you solve this? Use Apple's Digital Color Meter, it's not super great, but it is aware of color spaces and correctly converts to sRGB when picking a color, here I'm going to give you a good setup:

  1. Open Automator and Create a New Workflow that runs the AppleScript Code Below.
  2. Save it as Digital Color Meter Toggle.workflow
  3. Open System Preferences > Keyboard > Shortcuts > App Shortcuts and create a new Shortcut with name Digital Color Meter Toggle and with Key Combination ⌥⌘1
  4. Press ⌥⌘1 to open Digital Color Meter and in the App Menus and enable View > Display Values > as Hexadecimal
  5. Make sure the first drop down has Display in sRGB selected.
  6. Use ⌥⌘1 to toggle the Window ANYWHERE and ⌘⇧C to copy the color.
  7. ????
  8. Profit!
on run {input, parameters}
if application "Digital Color Meter" is running then
quit application "Digital Color Meter"
else
activate application "Digital Color Meter"
tell application "Digital Color Meter" to activate
end if
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment