Can I prevent the use of color profiles?

Create a picture.
Fill it with &cff0000
Display it in a paint event.

It wont be pure red.

How can I STOP this behavior in MacOS Xojo?

Colorspace of Xojo picture is Generic RGB on Mac.
So you draw in Generic RGB and it’s later matched to screen profile.

I vaguely remember that Einhugur has classes that do not apply the color profile, and respect the original color, as on Windows. You may want to ask Björn.

You can switch window to use screen color space:

[code]dim n as NSWindowMBS = self.NSWindowMBS
dim s as NSScreenMBS = NSScreenMBS.mainScreen

n.colorSpace = s.colorSpace[/code]

But I am not sure how to get the drawing in that colorspace, too.

escaping the generic RGB seems to be difficult.

[code]Sub DrawRect(g as NSGraphicsMBS, left as double, top as double, width as double, height as double) Handles DrawRect
dim r as NSColorMBS
dim s as NSScreenMBS = NSScreenMBS.mainScreen
dim n as NSColorSpaceMBS = s.colorSpace

r = NSColorMBS.colorWithColorSpace(n, 1.0, 0.0, 0.0, 1.0)

g.setFillColor r
g.fillRect new NSRectMBS(left, top, width, height)
End Sub[/code]

I have this in a NSViewControlMBS control on my window.
Now I see in screenshot it is really &cFF0000, but that’s not red. More magenta. Really strange to look on an unmatched color.

I will include example project with future plugins.

Thanks you for looking into this!