Mac bitmap and vector colors not consistent when using dispaly color settings

This is not a bug, more like an info to be aware of.

Recently I have encountered a problem (only on Mac), when I was drawing an svg logo on png background. I have a little svg parser, that reads (simple) svgs and draw them, mentioned in this thread.

Anyway, what I noticed was, that the colors were not the same! The svg has a background with the same color, as the main background, but it was just not the same color, as you can see in the picture.


So after some digging, I found out, that it was the color profile, that I have been using on my external monitor. You can find it in System preferences → Displays ->Colour. It was not matching the one on the native (macbook pro) display (“Colour LCD”). Also the external monitor was set as primary, in the Arrangement settings.

What I think is happening, is when the bitmaps are actually loaded, the main display color profile is loaded as well and the the colors of pixels are transformed. What is not happening on the other hand, is the transform of the colors in my svg renderer - using standard CDrawContext::drawLine(), drawArc() etc, because it reads the colors as they are from the svg file.

So the conclusion is, there could be improvements in the svg parser, but also if you are wondering why your colors don’t look the same when drawing some vector stuff using the CDawContext methods on same coloured png background, you now know why.