Infragistics
Close
Angular React Web Components Blazor Blazor
Premium

Blazor Color Editor Overview Preview

The Ignite UI for Blazor 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).

Blazor Color Editor Example

Dependencies

Add the IgniteUI.Blazor.Controls namespace in the _Imports.razor file:

@using IgniteUI.Blazor.Controls

Register the Ignite UI for Blazor services:

// in Program.cs file

builder.Services.AddIgniteUIBlazor();

Registering IgbColorEditorModule, the client resource module of the IgbColorEditor, is optional: the component loads its resources when it first renders. Listing it in builder.Services.AddIgniteUIBlazor(typeof(IgbColorEditorModule)) can be used to preload resources or to support elements created only on the client (see Component Modules).

Usage

The simplest way to start using the IgbColorEditor is as follows:

<IgbColorEditor
    @ref="colorEditor" />

Binding to events

The Color Editor component raises the following events:

  • valueChanged
  • valueChanging
<IgbColorEditor
    @ref="colorEditor"
    ValueChanged="ColorEditorValueChanged" />

The handler is passed the editor and a IgbColorEditorPanelSelectedValueChangedEventArgs, whose NewValue carries the color just chosen:

Console.WriteLine("selected color: " + args.NewValue);

API References

Additional Resources