GUI.Label Color won't change

Hello, I’m trying to get an UI element to change the font colour after making it change font size, here is my code below, what could I be doing wrong for it not to change?

private GUIStyle guiStyle = new GUIStyle();

public void OnGUI()
    {
        GUI.contentColor = Color.white;
        guiStyle.fontSize = 30;
        GUI.Label (new Rect (620, 200, 400, 100), attempts.ToString(), guiStyle);
    }

no idea, but at least this works:

GUI.Label(new Rect(620, 200, 400, 100), "<color=green>asdfasdfasdf</color>".ToString(), guiStyle);

GUI.contentColor specifies the tinting. Since white is (1,1,1,1), this means it will just show the current style’s color at full value.

You’ll want to change the GUIStyle’s color instead. Something like:

guiStyle.fontSize = 30;
guiStyle.normal.textColor = Color.white;
GUI.Label (new Rect (620, 200, 400, 100), attempts.ToString(), guiStyle);

Side note: If this is for runtime code, you may want to cache the return value of attempts.ToString() instead of computing it in every OnGUI() call.