React Color Editor Overview (preview)
The Ignite UI for React Color Editor is a lightweight color picker component. The Color Editor can pop open by clicking the brush icon. Both the rgba and hex values can be obtained from the desired color along the bottom. These values will update when the three sliders are modified. The center box is designed for adjusting the saturation and brightness along with two adjacent sliders for adjusting the rgb and luminance values. Rgb registers between (1-255). The lightness registers between(0-1).
React Color Editor Example
Dependencies
First, you need to install the Ignite UI for React by running the following command:
npm install igniteui-react-core
npm install igniteui-react-inputs
Before using the ColorEditor
, you need to register the following modules as follows:
import { IgrColorEditor, IgrColorEditorModule } from 'igniteui-react';
import 'igniteui-webcomponents/themes/light/bootstrap.css';
IgrColorEditorModule.register();
Usage
The simplest way to start using the ColorEditor
is as follows:
<IgrColorEditor
ref={this.colorEditorRef}>
</IgrColorEditor>
Binding to events
The Color Editor component raises the following events:
- valueChanged
- valueChanging
<IgrColorEditor valueChanged={this.onValueChanged} />
public onValueChanged(calendar: IgrColorEditor, e: IgrColorEditorPanelSelectedValueChangedEventArgs) {
}
API References
ColorEditor