We are having an application ported from Windows to Mac OS, and colors are being displayed differently on both platforms. Here’s an example:

In this case, we’re telling the application to use green 0,140,0 and blue 25,0,75. On windows, this works great (top image). On the Mac, apparently OS X decides to “reinterpret” the colors and displays them differently (bottom image).
Is there something we can do to tell the operating system to stop being creative with our color definitions? It’s going to be hard to make things look good on both platforms if the mac arbitrarily changes our color definitions by ~10%.
Edit: Here’s an example of the code we’re using to set the color for the blue used above:
m_colour = CGColorCreateGenericRGB(25 / 255.0, //r
0 / 255.0, //g
75 / 255.0, //b
1.0); //a
Thanks.
The Mac uses a complex colourspace system called ColorSync to ensure colours appear identical on different devices. As a result, colours may sometimes be shifted slightly in the RGB space so that they appear to the eye identical on properly calibrated displays, printers, etc.
If you show us the code you use to generate that shade of green, we can show you how to modify it to avoid this colour correction. However, unless there’s a pressing reason why you want to avoid it, it’s usually better to let it happen, as you do not have a wide range of display models to test against.
Edit:
CGColorCreateGenericRGB()creates a colour in the generic RGB colour space, so it’s going to end up shifting slightly depending on your display calibration. Unfortunately for you, it is no longer possible (as of Mac OS X 10.4) to create an instance ofCGColorthat is device-dependent (and therefore not subject to calibration.) You can, however, create aCGColorin the colour space of the target drawing context–that will tell Quartz that no conversion is necessary.If you’ve created the context yourself, you should keep a reference to the colour space you used (of the type
CGColorSpaceRef.) If it’s at the Cocoa level (such as the context created by-[NSImage lockFocus]or by-[NSView drawRect:]then you should use the relevantNSColorAPIs instead of theCGColorAPIs (i.e.+[NSColor colorWithDeviceRed:green:blue:alpha:].)If you must use Quartz drawing, you can call
CGContextSetRenderingIntent()to tell the context how you want to have colours converted, but there is no guarantee that a conversion will not take place.