sokol
sokol copied to clipboard
sokol_app.h macOS: investigate 'implicit' color space conversions
From @hb3p8 via Twitter:
We have noticed a while back that colors on screen (on macos using sokol_app) are different from the colors from the same framebuffer saved to file (and opened in photo viewer).
It looks like by default macos interprets colors produced by application as encoded with P3 colorspace and not sRGB (at least for OpenGL backend).
We have added this line to window init code and colors look fine now: [_sapp.macos.window setColorSpace:[NSColorSpace sRGBColorSpace]];
At least for me it was unexpected that system expects me to write P3 color by default, so maybe it needs some treatment at sokol_app level?
A bit more context, solution is actually from here: https://github.com/google/filament/blob/main/libs/filamentapp/src/NativeWindowHelperCocoa.mm