Search results

Mode and Value

Rendering palette at initial load

By default, the Picker area will be rendered at initial load. To render the Palette area while opening the ColorPicker pop-up, specify the Mode property as Palette.

In the following sample, it will render the Palette at initial load.

@using Syncfusion.EJ2.Blazor.Inputs

<h4>Choose a color</h4>
<EjsColorPicker Mode="ColorPickerMode.Palette"></EjsColorPicker>

Output be like color-picker

Color value

The Value property can be used to specify the color value to the ColorPicker. It supports either three or six digit hex codes. To include opacity, set the color value as four or eight digit hex code.

In the following sample, the color value sets as four digit hex code, the last digit represents the opacity value.

@using Syncfusion.EJ2.Blazor.Inputs

<h4>Choose a color</h4>
<EjsColorPicker Value="035a" ModeSwitcher="false"></EjsColorPicker>

Output be like color-picker

The Value property supports hex code with or without # prefix.