Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug (Case 1201922) Colors render differently between 2019.2 and 2019.3

Discussion in '2019.3 Beta' started by Aka_ToolBuddy, Nov 29, 2019.

  1. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    547
    Hi,

    In one of my assets, I use GUI.Box to draw inside a tool window. The color of the drawn box is different when using 2019.3, it is darker. Did anyone notice the same issue? Is there a fix for this, or at least some formula to get a color equivalent to the one rendred in Unity pre-2019.3?

    Here is how this test code is rendred in Unity pre-2019.3
    upload_2019-11-29_14-3-5.png
    and how the same code is rendred in Unity 2019.3
    upload_2019-11-29_14-2-27.png

    and here is the code used in the test

    Code (CSharp):
    1.     public class CGGraph : EditorWindow
    2.     {
    3.  
    4.         internal static CGGraph Open()
    5.         {
    6.             return GetWindow<CGGraph>();
    7.         }
    8.  
    9.         void OnGUI()
    10.         {
    11.             float grayLevel = 0.5f;
    12.             GUI.backgroundColor = new Color(grayLevel, grayLevel, grayLevel, 1);
    13.             GUI.Box(new Rect(0, 0, 500, 500), "Test");
    14.         }
    15.     }
     
    LeonhardP likes this.