Change GUILayout.Button font color


I have to create a strange keyboard and I have some problems…

GUILayout.BeginArea(new Rect(x,y,2*v/3,b/3));
GUILayout.BeginHorizontal(“fila 1”);
if(GUILayout.Button(“Q”,GUILayout.Width(t),GUILayout.Height(t))) key=‘q’; if(GUILayout.Button(“W”,GUILayout.Width(t),GUILayout.Height(t))) key=‘w’;


I need to paint 5 letters in red…

How can I change the GUILayout Button font color?


If you are using a GUILayout.Button instead of a GUI.Button you can use a GUIStyle:

var style = new GUIStyle(;
style.normal.textColor =;
GUILayout.Button("Label", style);

You can use GUI.contentColor to give a specific part an other color :

function OnGUI() {

    GUI.Button("Standard Colored")
    GUI.contentColor =;  // Apply Red color to Button
    GUI.Button("Q button")
    GUI.Button("W button")  //...and so on for the rest Buttons
    GUI.contentColor = Color.withe;  //Make Buttons White color again 
    GUI.Button("White Colored Again")

For information, the second solution works in the editor, the first only for in-game UI (which is depreciated and shouldn’t be used AFAIK). :slight_smile: