Description
The Color.Gray
field represents a fully opaque gray color, which is exactly halfway between white and black. This color is useful for creating neutral tones in your application or game, providing a balanced and non-distracting background or element color.
Usage
You can use Color.Gray
whenever you need a standard gray color in your application. It is a static field, so you can access it directly from the Color
struct without needing to instantiate a Color
object.
Example
// Example of using Color.Gray in a scene
GameObject myObject = new GameObject();
myObject.Color = Color.Gray; // Set the object's color to gray
// Example of using Color.Gray in a UI element
UIElement myButton = new UIElement();
myButton.BackgroundColor = Color.Gray; // Set the button's background color to gray