g.Drawline color off on Mac

Does anyone know why the color of a drawn line in a Canvas is off on the Mac (10.9.5) using Cocoa, 32-bit? It’s a simple program one window with a canvas on it. In the Paint event of the canvas, just these two lines:

g.ForeColor = RGB(200,200,200)
g.DrawLine 1, 1, g.width - 1, 1

I run it, and take a screensheet and load the pic up in an drawing program. On the OC, it is indeed a line that is RGB(200,200,200). On the Mac, it comes out as RGB(210,210,210). All colors tend to run lighter, except for at RGB(0,0,0) it comes out the same. Is there any explanation for this? I can’t drawn lines to match the colors of a pic in the actual program I am working on.

has the picture you’re trying to match got am embedded color profile ?

No, I’m just pasting it into the Image editor. But leave that out of the equation, you can see it is off on the screen in the real program. The pic I am drawing to the canvas shows the correct colors, but the drawline is lighter. On Windows they match perfectly in the Xojo program on screen (and in the editor if I take it over there). On the Mac screen you can see it is clearly off. The image editor where I can see the numerical value of the color just confirms what I can visually see.

Let me mess with this some, that has to be the issue. The pic originally came from a screenshot from my Mac, does that embedded any profiles? I can’t tell from the editor.

Yup. It gets the profile that is associated with the monitor itself

OK, thanks Greg. I’ve tried different profiles, let me start with a clean image form the editor and see if that makes a difference.

I have also been seeing these colour shifts.

When Xojo’s Mac UI went over from Carbon to Cocoa there was a noticeable difference in the way colour hues were rendered on screen, irrespective of colour profiles. I posted a Feedback report at the time but I don’t have the case number to hand as I am not at my computer.

Carbon colours corresponded quite well with Windows while Cocoa does not, creating an issue for cross- platform applications.

It can be clearly demonstrated with a very simple test.

  1. Create a new document in Photoshop without a colour profile, RGB mode.
  2. Fill the canvas with a colour. I used #FF0080.
  3. Test the displayed colour using a digital colour meter, native values, result: 252,22,129.
  4. Create a project in Xojo having a window with canvas and in the Paint event add the code:

g.Forecolor=&cff0080 g.FillRect(0, 0, 300, 200)
5. If you have an older version of Xojo, run it under Carbon.
6. The digital colour meter should give the same reading as above.
7. Run it under Cocoa. The reading I get is 255,54,149 and the colour is noticeably different

I found the Feedback case: feedback://showreport?report_id=22980

BTW I just noticed the forum restarts the numbering if I insert code in the post.