System.Nullable<Color> BackgroundColor { get; set; }

robot_2Generated
code_blocksInput

Description

The BackgroundColor property in the Sandbox.UI.BaseStyles class represents the background-color CSS property. It allows you to set or retrieve the background color of a UI element using a nullable Color type. This property is useful for defining the visual appearance of UI components by specifying their background color.

Usage

To use the BackgroundColor property, you can assign a Color value to it. If you want to remove the background color, you can set it to null. This property is not static, so it must be accessed through an instance of the BaseStyles class or a derived class.

Example

// Example of setting the BackgroundColor property
var styles = new BaseStyles();
styles.BackgroundColor = new Color(255, 0, 0); // Sets the background color to red

// Example of clearing the BackgroundColor property
styles.BackgroundColor = null; // Removes the background color