Digital Color Meter
macOS ships with a handy piece of software called Digital Color Meter that you can use to find the colour of something on your screen.
- Open Digital Color Meter (found in Applications → Utilities).
- Click View → Display Values → as Hexadecimal.
- Hover over the thing you’d like to sample:
Shift-Command-Cto copy the colour as a hex code.
Option-Command-Cto copy the colour as an image.