- Home /
How to change color of EditorGUI.ProgressBar ?
I want to show ProgressBar and i am using below code.
EditorGUI.ProgressBar(Rect(3,45,100-6,20),20/700.0, "Armor");
but i want to change the color of ProgressBar(light blue) color to red color. How can i do that?
Thanks in advance.
Answer by IgorAherne · Sep 12, 2017 at 08:49 PM
Don't really remember, but perhaps
GUI.contentColor = Color.red; // for text
or
GUI.color =new Color(1,1,1,1) //for background
I had tried GUI.contentColor but it doesn't work, So I tried GUI.color and it works! But it changes the whole progress bar except the text. I tried to change the color's alpha to .75 for the second one, So it might look better.
Your answer
Follow this Question
Related Questions
EditorGUI.ObjectField placed right below EditorGUI.Foldout? 1 Answer
Does Unity IMGUI for Editor use DirectX on Windows? 0 Answers
Custom Editor GUI Elements 1 Answer
Default toggle style 1 Answer
Resize UI Button via Script 2 Answers