Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The reason for the difference is that colors created with obj-c are adjusted to take the current color profile into account (see system preferences -> Monitors -> Colors). This goes so far that the same color appears differently when you have several monitors and drag your running application from one monitor to the other. Unfortunately, it's extremely difficult to use an exact color on a particular monitor, even if you use colorWithDeviceRed:Green:Blue:Alpha instead colorWithCalibratedRed:Green:Blue:Alpha.</p> <p>Color perception is a complex matter and various output devices play an important role, so no wonder there is no 1:1 mapping. But it should really be possible to create a color (say in a painting app or color management app, designer app etc.) and recreate the exact same color in Cocoa, if both run on the same monitor.</p> <p>Interesting to note is here: when you have your colors in a design on OSX (be it an image in a browser or PDF file or whatever) and use its component values in a Windows app in a virtual machine (e.g. in Parallels Desktop) you can reproduce the exact color as any screen color picker shows.</p> <p>[Update]: Since setting the system color profile to a generic one solves the color matching it might be worth thinking about creating an own generic color space in code as described in this <a href="https://developer.apple.com/library/mac/#qa/qa1396/_index.html" rel="nofollow">technical Q&amp;A</a></p> <p>[Update]: I just found another NSColor message that looks like is what we both are looking for:</p> <pre><code>NSColor colorWithSRGBRed:green:blue:alpha </code></pre> <p>In a few tests I could see the color was exact. Unfortunately this message is only available on 10.7 and higher.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload