Orange Color in Scripts

I’ve made a Menu Item script and made a mouse over function to represent a color. So when I try to put orange it doesn’t seem to work, how can I fix that.

Script - Menu Item

    var isQuitBtn = false;

function OnMouseEnter () 
	renderer.material.color = Color.yellow;

function OnMouseExit () 
	renderer.material.color = Color.white;

function OnMouseUp()
  • Felipe

you have to create rgb colors from 0 to 1.

orange color has the rgb color 255, 165, 0

to get 165 in relation, use the formula 165 / 255
Color _orange = new Color(1.0f, 0.64f, 0.0f);

Hi ,

you may give r,g,b components directly. but i dunno exact r,g,b values for Orange. you may try with this,

If you want to change color for GUI simply use GUI.Style for mouse over color change.

If you wish to change color for a material just use the below script, i dunno exact value for orange.

public Color color = new Color(0.2F, 0.3F, 0.4F);
 transform.renderer.material.color = color;

here is the links