RadzenColorPicker Class

A color picker component that allows users to select colors through various input methods including color palette, RGB sliders, hex input, and predefined swatches. RadzenColorPicker provides a comprehensive color selection interface with alpha channel support. Displays a button showing the current color. Clicking opens a popup with multiple color selection methods including visual picker (click on hue/saturation gradient to select colors visually), hue/alpha sliders to fine-tune hue and transparency, RGB input to enter specific Red/Green/Blue values (0-255), hex input to enter hex color codes (#RRGGBB or #RRGGBBAA), and predefined swatches for quick selection. The Value is a hex color string (e.g., "#FF0000" for red, "#FF0000AA" for semi-transparent red). Supports alpha channel (transparency) in RGBA format. Use for applications requiring color customization like themes, charts, or design tools.

Inheritance

Object

ComponentBase

RadzenComponent

FormComponent<string>

RadzenColorPicker

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Inherited Members

FormComponent<string>.Dispose

FormComponent<string>.GetValue

FormComponent<string>.OnContextMenu

FormComponent<string>.GetClassList

FormComponent<string>.FocusAsync

FormComponent<string>.Name

FormComponent<string>.TabIndex

FormComponent<string>.Placeholder

FormComponent<string>.Disabled

FormComponent<string>.EditContext

FormComponent<string>.Form

FormComponent<string>.ValueChanged

FormComponent<string>.HasValue

FormComponent<string>.IsBound

FormComponent<string>.Value

FormComponent<string>.Change

FormComponent<string>.FieldIdentifier

FormComponent<string>.ValueExpression

FormComponent<string>.FormFieldContext

FormComponent<string>.CurrentPlaceholder

FormComponent<string>._value

RadzenComponent.OnMouseEnter

RadzenComponent.OnMouseLeave

RadzenComponent.GetCssClass

RadzenComponent.GetId

RadzenComponent.Debounce

RadzenComponent.OnAfterRenderAsync

RadzenComponent.RaiseContextMenu

RadzenComponent.RaiseMouseEnter

RadzenComponent.AddContextMenu

RadzenComponent.RaiseMouseLeave

RadzenComponent.OnBecameInvisible

RadzenComponent.Attributes

RadzenComponent.Element

RadzenComponent.MouseEnter

RadzenComponent.MouseLeave

RadzenComponent.ContextMenu

RadzenComponent.Culture

RadzenComponent.DefaultCulture

RadzenComponent.Style

RadzenComponent.Visible

RadzenComponent.UniqueID

RadzenComponent.JSRuntime

RadzenComponent.IsJSRuntimeAvailable

RadzenComponent.Reference

RadzenComponent.CurrentStyle

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenColorPicker : FormComponent<string>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent

Examples

Basic color picker:

<RadzenColorPicker @bind-Value=@backgroundColor />
@code {
    string backgroundColor = "#FF5733";
}

Color picker with predefined swatches:

<RadzenColorPicker @bind-Value=@color Change=@OnColorChange>
    <RadzenColorPickerItem Value="#FF0000" />
    <RadzenColorPickerItem Value="#00FF00" />
    <RadzenColorPickerItem Value="#0000FF" />
</RadzenColorPicker>

Constructors

RadzenColorPickerlink

A color picker component that allows users to select colors through various input methods including color palette, RGB sliders, hex input, and predefined swatches. RadzenColorPicker provides a comprehensive color selection interface with alpha channel support. Displays a button showing the current color. Clicking opens a popup with multiple color selection methods including visual picker (click on hue/saturation gradient to select colors visually), hue/alpha sliders to fine-tune hue and transparency, RGB input to enter specific Red/Green/Blue values (0-255), hex input to enter hex color codes (#RRGGBB or #RRGGBBAA), and predefined swatches for quick selection. The Value is a hex color string (e.g., "#FF0000" for red, "#FF0000AA" for semi-transparent red). Supports alpha channel (transparency) in RGBA format. Use for applications requiring color customization like themes, charts, or design tools.

Declaration
public RadzenColorPicker()

Properties

AlphaTextlink

Gets or sets the alpha label text.

Declaration
public string AlphaText { get; set; }
Property Value
Type Description
stringGets or sets the alpha label text.

BlueTextlink

Gets or sets the blue color label text.

Declaration
public string BlueText { get; set; }
Property Value
Type Description
stringGets or sets the blue color label text.

ButtonTextlink

Gets or sets the button text.

Declaration
public string ButtonText { get; set; }
Property Value
Type Description
stringGets or sets the button text.

ChildContentlink

Gets or sets the child content.

Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type Description
RenderFragmentGets or sets the child content.

Closelink

Gets or sets the close callback.

Declaration
public EventCallback Close { get; set; }
Property Value
Type Description
EventCallbackGets or sets the close callback.

GreenTextlink

Gets or sets the green color label text.

Declaration
public string GreenText { get; set; }
Property Value
Type Description
stringGets or sets the green color label text.

HexTextlink

Gets or sets the hexadecimal color label text.

Declaration
public string HexText { get; set; }
Property Value
Type Description
stringGets or sets the hexadecimal color label text.

Iconlink

Gets or sets the icon.

Declaration
public string Icon { get; set; }
Property Value
Type Description
stringGets or sets the icon.

IconColorlink

Gets or sets the icon color.

Declaration
public string IconColor { get; set; }
Property Value
Type Description
stringGets or sets the icon color.

Openlink

Gets or sets the open callback.

Declaration
public EventCallback Open { get; set; }
Property Value
Type Description
EventCallbackGets or sets the open callback.

PopupAriaLabellink

Gets or sets the popup aria label text.

Declaration
public string PopupAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the popup aria label text.

PopupRenderModelink

Gets or sets the render mode.

Declaration
public PopupRenderMode PopupRenderMode { get; set; }
Property Value
Type Description
PopupRenderModeGets or sets the render mode.

RedTextlink

Gets or sets the red color label text.

Declaration
public string RedText { get; set; }
Property Value
Type Description
stringGets or sets the red color label text.

ShowButtonlink

Gets or sets a value indicating whether button is shown.

Declaration
public bool ShowButton { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether button is shown.

ShowColorslink

Gets or sets a value indicating whether colors are shown.

Declaration
public bool ShowColors { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether colors are shown.

ShowHSVlink

Gets or sets a value indicating whether HSV is shown.

Declaration
public bool ShowHSV { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether HSV is shown.

ShowRGBAlink

Gets or sets a value indicating whether RGBA is shown.

Declaration
public bool ShowRGBA { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether RGBA is shown.

ToggleAriaLabellink

Gets or sets the toggle popup aria label text.

Declaration
public string ToggleAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the toggle popup aria label text.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

OnInitializedlink

Declaration
protected override void OnInitialized()

SetParametersAsynclink

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙