Color
The Color category in the @itwin/imodel-components-react
package includes
classes and components for working with and picking a Color.
Component | Description |
---|---|
AlphaSlider | used to set the alpha value for a color |
ColorPickerButton | used to pick a color from an array of available colors |
HueSlider | used to set the hue value for a color |
SaturationPicker | used to set the saturation value for a color |
ColorSwatch | displays a color swatch in a button |
Samples
Multiple Color Components Used Together
The following sample shows the components above used together to form a color picker.
Imports
State
Preset Colors
render() method
Handler Functions
ColorPickerButton Sample
The following sample shows the ColorPickerButton component used to pick a color.
Imports
State
render() method
Handler Function
Note: The properties for the ColorPickerButton are defined in the ColorPickerProps interface. The optional colorDefs
prop may be used to provide the available colors.
API Reference
Last Updated: 02 February, 2022