This is a functionality that Photoshop has. It works like this:
- Choose the eyedropper tool
- Left click and hold anywhere on the canvas
- While still holding, move the eyedropper tool outside of the program and release click over the colour you want to select
- That colour will now be loaded as the foreground colour swatch.
This eliminates the need to bring in reference to the program for the sole purpose of picking a colour from it.