Skip to content

Instantly share code, notes, and snippets.

@MarioRicalde
Last active August 15, 2017 01:22
Show Gist options
  • Save MarioRicalde/9010851 to your computer and use it in GitHub Desktop.
Save MarioRicalde/9010851 to your computer and use it in GitHub Desktop.

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 DigitalColor 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 DigitalColor Meter Toggle.workflow
  3. Open System Preferences > Keyboard > Shortcuts > App Shortcuts and create a new Shortcut with name DigitalColor Meter Toggle and with Key Combination ⌥⌘1
  4. Press ⌥⌘1 to open DigitalColor 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 "DigitalColor Meter" is running then
quit application "DigitalColor Meter"
else
activate application "DigitalColor Meter"
tell application "DigitalColor 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