Unity 6 + URP = IMGUI colors on macOS look washed out

I replaced the IMGUI skin with new textures set to “Editor GUI and Legacy GUI” and in Unity 6 using the URP defaults the colors look very washed out compared to Windows (see below). Some Googling shows that various people complain about this but I couldn’t find any clear fix or setting for this. How can I fix and get the colors to match on both platforms?
NOTE: the macOS Editor project file thumbnails are correctly colored

EDIT: From what I can see, it appears that the editor correctly treats all GUI elements as sRGB color space and renders it accordingly (with gamma?) whereas the game window renderer seems to use the wrong color space. On Apple devices I think they use/expect a P3 wider gamut color space, but that shouldn’t make the color as washed out as it is. Looking through the reference source on GitHub, it only has the C# and I can’t see the renderer/shader code, but I would guess that the underlying shader and material are using the wrong color space when calculating final pixel color.

EDIT 2: I found in UnityUIE.cginc the following block which the UnityUI.cginc doesn’t seem to have something similar:

#ifndef UIE_COLORSPACE_GAMMA
    // Note: When the editor shader is compiled, UNITY_COLORSPACE_GAMMA is ALWAYS set because it is the color space
    // of the editor resources project.
    #if defined(UNITY_COLORSPACE_GAMMA) || defined(UIE_FORCE_GAMMA)
        #define UIE_COLORSPACE_GAMMA 1
    #else
        #define UIE_COLORSPACE_GAMMA 0
    #endif // UNITY_COLORSPACE_GAMMA
#endif // UIE_COLORSPACE_GAMMA

Whereas in UnityUI.cginc it specifically does a conversion:

// This piecewise approximation has a precision better than 0.5 / 255 in gamma space over the [0..255] range
// i.e. abs(l2g_exact(g2l_approx(value)) - value) < 0.5 / 255
// It is much more precise than GammaToLinearSpace but remains relatively cheap
half3 UIGammaToLinear(half3 value)
{
    half3 low = 0.0849710 * value - 0.000163029;
    half3 high = value * (value * (value * 0.265885 + 0.736584) - 0.00980184) + 0.00319697;

    // We should be 0.5 away from any actual gamma value stored in an 8 bit channel
    const half3 split = (half3)0.0725490; // Equals 18.5 / 255
    return (value < split) ? low : high;
}

But no idea if this is the cause or related sadly…




1 Like

Having this same problem Unity 6 HDRP. Oddly enough downloaded images via WebRequest on RawImage don’t seem affected. Could also be an HDR issue on Mac. Unfortunately I can’t switch to gamma colorspace and still use HDRP.

I filed a bug on this and Unity confirmed it’s an issue. There is discussion about whether they will fix it internally (apparently).

1 Like

Do you have a link to the issue tracker?

They marked it as won’t fix and I pushed back and now being discussed to fix internally. IN-87105
https://unity3d.atlassian.net/servicedesk/customer/portal/2/IN-87105

Well I’ve tried just about everything short of writing a mac specific UI shader for all my UI elements to manually do the color conversion. I hope they fix this soon, my whole project is UI targeting MacOS and it looks sooo bad washed out.

I’ve noticed unchecking sRGB in the image import settings washes out the images in the same way.

Anywork arounds? Maybe I should build on Mac, been building for MacOS on Windows using mono, running out of things to test.