Color

From Unify Community Wiki
Jump to: navigation, search

The color class is unity is based off an RGBA model, where the values for red, green, blue, and alpha(transparency) are specified with float values between 0 and 1. An alpha of 0 is completely transparent, while 1 is fully opaque. A color can be created with or without the alpha value specified.

Creating Color in Unity

Creating a color in CSharp:

public Color myColor = new Color(.2f, .3f, .4f);
public Color transparentColor = new Color(.2f, .3f, .4f, 0);

Creating a color in JavaScript:

var myColor : Color = Color(0.2, 0.3, 0.4,);
var transparentColor : Color = Color(0.2, 0.3, 0.4, 0);
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox