ColorPicker
Description
The ColorPicker component provides a native browser widget for selecting colors. It is part of the Tesserae UI library's Components group and is ideal when you need to allow users to choose colors in your application. By default, it displays black unless a different preset color is specified. The component supports programmatically setting its value and validating user input.
Usage
Instantiate the ColorPicker using the Tesserae.UI static helper method. You can either create a basic ColorPicker or specify a preset color by providing a Color argument. The component exposes a Color property for getting or setting the current color, and a SetColor method to update the color, which in turn updates the displayed hex value.
API reference
public class ColorPicker : Input<ColorPicker>A form input for picking a color, backed by the browser's native color input.
Constructors
Properties
Samples
Basic Usage of ColorPicker
The following sample demonstrates how to instantiate the ColorPicker component, attach an event handler to update another component's background based on the selected color, and display the currently selected value when a button is clicked.