objective-cmacosnscolor

What's the difference between colorWithSRGBRed vs colorWithDeviceRed vs colorWithCalibratedRed


There are several convenience class methods for creating a NSColor. However, I can't seem to identify when to use the different class methods below:

colorWithSRGBRed:green:blue:alpha: vs colorWithDeviceRed:green:blue:alpha: vs colorWithCalibratedRed:green:blue:alpha:


Solution

  • tl;dr Use the calibrated colour space.

    Rather than regurgitate the documentation - the answer is in the Color Programming Topics

    Also the Color Space Overview

    enter image description here

    Edited to add

    sRGB is one of the named Color Spaces.

    enter image description here

    Finally - and this is the last image from the documentation, and I hope it answers your question - if you want to use a color space, use the calibrated one.

    enter image description here