Search Unity

Unity UI Inaccuracies in font colour using linear colour space

Discussion in 'UGUI & TextMesh Pro' started by _JBMC, Oct 14, 2019.

  1. _JBMC

    _JBMC

    Joined:
    Mar 3, 2015
    Posts:
    1
    Hi,

    Preface
    Scenario settings
    • Unity 2019.2.6f1
    • Project settings: linear colour space
    • Background texture import settings: Sprite with sRGB enabled
    • Default UI/Font shader
    Issue
    I'm having trouble solving an issue with font colour values on uGUI text components - for some reason the "Color" value set on the Text component is not the final displayed colour in game (or scene view).

    [It's quite hard to see based on the colours being used but these are the conditions I am having trouble with.]


    My desired colour is #11101A (The exact colour of the background image), but when I try to set the font to the same value the output colour I get is #0D0D1C. Unity doesn't seem to be able to differentiate between a font colour of #11101A and one of #0D0D1C.

    In the picture above I have also done two example using a shader to tint the text field, Example 3 the tint is set to #11101A (perfect - unable to see) and Example 4 the tint is set to #0D0D1C (obviously not correct but used to outline the issue).

    This issue seems to only occur when using linear colour space and I'd rather not change to using gamma space. If anyone has some insight into what's causing the issue and even how to solve it, I would really appreciate it.

    Gamma space version/expect output:
     
    Last edited: Oct 15, 2019