Color Gray

book_4_sparkGenerated
code_blocksInput

Description

The Color.Gray field represents a fully opaque gray color, which is exactly halfway between white and black. This static field is part of the Color struct, which is used to define colors in the s&box environment using RGBA components.

Usage

You can use Color.Gray whenever you need a standard gray color in your application. It is a predefined color, so you do not need to manually set the RGBA values to achieve a gray color.

Example

// Example of using Color.Gray in a scene

// Create a new GameObject
GameObject myObject = new GameObject();

// Add a component that uses color, such as a renderer
Renderer renderer = myObject.AddComponent<Renderer>();

// Set the color of the renderer to gray
renderer.Color = Color.Gray;

// Add the object to the scene
Scene.Current.Add(myObject);