float Item { get; set; }

robot_2Generated
code_blocksInput

Description

The Item property of the Color struct represents a single component of the color, such as red, green, blue, or alpha, as a float value. This property is used to access or modify the individual components of a color object.

Usage

Use the Item property to get or set the value of a specific color component. The property is indexed, allowing you to specify which component to access by its index:

  • 0 for the red component
  • 1 for the green component
  • 2 for the blue component
  • 3 for the alpha component

Note that this property is marked with the JsonIgnore attribute, meaning it will be ignored during JSON serialization and deserialization.

Example

Color color = new Color(0.5f, 0.4f, 0.3f, 1.0f);

// Accessing the red component
float redComponent = color[0];

// Modifying the green component
color[1] = 0.6f;

// Accessing the blue component
float blueComponent = color[2];

// Modifying the alpha component
color[3] = 0.8f;