Search Issue Tracker
Fixed
Fixed in 2022.3.0f1, 2023.2.8f1, 2023.3.0a17
Votes
0
Found in
2022.3.0f1
2023.2.0b17
2023.3.0a13
Issue ID
UUM-54820
Regression
No
The <color=lightblue> and <color=grey> tags in TextMeshPro UGUI 2.x no longer work
Description: Please note, this is being reported by Microsoft. We have a contractual obligation to fix their issues as part of XR Partnership between Unity and Microsoft.
Both the <color=lightblue> and <color=grey> tags in TextMeshPro UGUI 2.x do not work.
After updating to our TextMeshPro to UGUI 2.0, in Unity 2023, we noticed that some color strings no longer work. Bot "lightblue" and "grey" worked in previous versions of TextMeshPro, but no longer work in UGUI 2.0. Note, other colors like "black" and "yellow", still work in UGUI 2.0.
The bug appears to be in the TMP_Text.cs file. In UGUI 2.0 the code is
{{// <color=name>
switch (m_xmlAttribute[0].valueHashCode)
{
case (int)MarkupTag.RED: // <color=red>
m_htmlColor = Color.red;
m_colorStack.Add(m_htmlColor);
return true;
case -992792864: // <color=lightblue>
m_htmlColor = new Color32(173, 216, 230, 255);
m_colorStack.Add(m_htmlColor);
return true;
case (int)MarkupTag.BLUE: // <color=blue>
m_htmlColor = Color.blue;
m_colorStack.Add(m_htmlColor);
return true;
case 3680713: // <color=grey>
m_htmlColor = new Color32(128, 128, 128, 255);
m_colorStack.Add(m_htmlColor);
return true;
case (int)MarkupTag.BLACK: // <color=black>
m_htmlColor = Color.black;
m_colorStack.Add(m_htmlColor);
return true;
case (int)MarkupTag.GREEN: // <color=green>
m_htmlColor = Color.green;
m_colorStack.Add(m_htmlColor);
return true;
case (int)MarkupTag.WHITE: // <color=white>
m_htmlColor = Color.white;
m_colorStack.Add(m_htmlColor);
return true;
case (int)MarkupTag.ORANGE: // <color=orange>
m_htmlColor = new Color32(255, 128, 0, 255);
m_colorStack.Add(m_htmlColor);
return true;
case (int)MarkupTag.PURPLE: // <color=purple>
m_htmlColor = new Color32(160, 32, 240, 255);
m_colorStack.Add(m_htmlColor);
return true;
case (int)MarkupTag.YELLOW: // <color=yellow>
m_htmlColor = Color.yellow;
m_colorStack.Add(m_htmlColor);
return true;
}}}
Where...
{{ // Named Colors
RED = 91635,
GREEN = 87065851,
BLUE = 2457214,
YELLOW = -882444668,
ORANGE = -1108587920,
BLACK = 81074727,
WHITE = 105680263,
PURPLE = -1250222130,}}
In earlier versions the code is:
{{// <color=name>
switch (m_xmlAttribute[0].valueHashCode)
{
case 125395: // <color=red>
m_htmlColor = Color.red;
m_colorStack.Add(m_htmlColor);
return true;
case -992792864: // <color=lightblue>
m_htmlColor = new Color32(173, 216, 230, 255);
m_colorStack.Add(m_htmlColor);
return true;
case 3573310: // <color=blue>
m_htmlColor = Color.blue;
m_colorStack.Add(m_htmlColor);
return true;
case 3680713: // <color=grey>
m_htmlColor = new Color32(128, 128, 128, 255);
m_colorStack.Add(m_htmlColor);
return true;
case 117905991: // <color=black>
m_htmlColor = Color.black;
m_colorStack.Add(m_htmlColor);
return true;
case 121463835: // <color=green>
m_htmlColor = Color.green;
m_colorStack.Add(m_htmlColor);
return true;
case 140357351: // <color=white>
m_htmlColor = Color.white;
m_colorStack.Add(m_htmlColor);
return true;
case 26556144: // <color=orange>
m_htmlColor = new Color32(255, 128, 0, 255);
m_colorStack.Add(m_htmlColor);
return true;
case -36881330: // <color=purple>
m_htmlColor = new Color32(160, 32, 240, 255);
m_colorStack.Add(m_htmlColor);
return true;
case 554054276: // <color=yellow>
m_htmlColor = Color.yellow;
m_colorStack.Add(m_htmlColor);
return true;
}}}
In 2023, it appears that the hash value was updated for all colors expect "grey" and "lightblue". This is likely the problem.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Search field in UI Builder's Library has no character limit
- Changing the value in UI Builder by dragging increases it by a few thousand points when reaching the borders of the screen
- ARM64 architecture DLL incorrectly copied instead of x64 when building for Windows x64
- Crash on TypeTreeIterator::GetNode when opening a specific folder
- Crash on WriteSerializedAssetsV2 when (re)entering the Play Mode in a specific project when IEnumerator Start() is used
Resolution Note (fix version 2023.3.0a17):
Added missing grey and lightblue tags
Resolution Note (fix version 2022.3.0f1):
Added missing grey and lightblue tags