开发者

NSColor: colorWithDeviceRed... is not working on second monitor

In order to be able to calibrate a monitor, I must be able to drive it in device RGB values.

In order to do this I create a NSColor by:

[NSColor colorWithDeviceRed:(colorsPtr[cnt]/255.0f) green:(colorsPtr[cnt+1]/255.0f)
blue:(colorsPtr[cnt+2]/255.0f) alpha:1.0]

And then I put this Color on the View.

[colorView setColor:[colorsForMeasuring objectAtIndex:index]];

When I use the "DigitalColor meter", this device color is only applied without any conversion when the View is shown on the primary 开发者_如何学运维monitor. So only on the monitor that has the menu bar on it.

In case you put the view on your second monitor, it looks as if there happens a conversion from RGB of main display to RGB of the second display. You only see this if there is a big difference between gamuts of both displays. I have a MacBook Pro with an Eizo ColorEdge CG 245 for example. If you then put [0 0 1.0] you might get something like [0.2 0.1 1.0].

Anyone an idea how to get rid of this extra conversion. Up to my opinion deviceRGB should be deviceRGB. In order to make a profile for the second monitor, this is mandatory. Now I have to move the menubar to the second monitor, create the profile and move it back. But with our application customers need to be able to do a validation and this needs to be done frequently. And the same problems occurs here.


That sounds like a bug to me. I suggest reporting it.

As a workaround, you might try implementing a custom view in which you respond to drawRect: by calling CGContextSetRGBFillColor and CGContextFillRect. (You can get the CGContext from the current NSGraphicsContext.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜