You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve noticed some discrepancies between colors in Processing and sketches I’ve ported over to ocaml-canvas:
Processing:
ocaml-canvas:
Here, the sky color was meant to be Color.of_rgb 255 240 225, but in the ocaml-canvas version I get 254 243 232 when inspecting the window with the Digital Color Meter app on macOS. In the Processing version it is the same as I expected. I’m wondering if this is a color space issue? I hear that SRGB vs. Linear can sometimes cause problems.
The text was updated successfully, but these errors were encountered:
kCGColorSpaceGenericRGB seems like a deprecated version of kCGColorSpaceSRGB (which explains why searching for sRGB in the repo came up with nothing). I’m not sure what color space Processing is using. Perhaps it’s doing something equivalent to initialising the color space with CGColorSpaceCreateDeviceRGB?
Wondering if it would be helpful to be able to set the color space? Also, is the color space consistent between the different back ends? Not sure what the best practices for this kind of thing is.
Hi,
Thanks for your investigation.
To be honest I never actually dug into color space management. It is quite possible that the different backends are currently not consistent.
We aim to remain compatible with HTML5 Canvases, which seem to use sRGB (some recent browsers seem to allow specifying a different color space).
I'll have a look at this when I find a moment.
I’ve noticed some discrepancies between colors in Processing and sketches I’ve ported over to ocaml-canvas:
Processing:
ocaml-canvas:
Here, the sky color was meant to be
Color.of_rgb 255 240 225
, but in the ocaml-canvas version I get254 243 232
when inspecting the window with the Digital Color Meter app on macOS. In the Processing version it is the same as I expected. I’m wondering if this is a color space issue? I hear that SRGB vs. Linear can sometimes cause problems.The text was updated successfully, but these errors were encountered: