Color Picker

Color Picker provides a workflow to change color, modify transparency, and save favorite colors.

Overview

Color Picker sliders can be used for general hue shifts, while hexadecimal (Hex) and other channels such as RGB can be used for more exact color choices. The ability to save colors helps keep the user experience more efficient.

Channels and features can be hidden with properties to keep the workflow focused.

Usage

  • Choosing an initial color of an element
  • Changing color or transparency of an element
  • Ability to copy/paste Hex, RGB, HSV, or other values

Sample

2 samples
1
<calcite-color-picker></calcite-color-picker>
v3.0.3

Keyboard navigation

KeyFunction
Arrow downWhen focused on the Hex, RGB, or HSV inputs decreases the value by one (1).
Arrow upWhen focused on the Hex, RGB, or HSV inputs increases the value by one (1).
Shift and Arrow downWhen focused on the Hex, RGB, or HSV inputs decreases the value by ten (10).
Shift and Arrow upWhen focused on the Hex, RGB, or HSV inputs increases the value by ten (10).
TabMoves focus to the next focusable element. If the currently focused element is the last element, focus will leave the component.
Tab and ShiftMoves focus to the previous focusable element. If the currently focused element is the first element, focus will leave the component.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
allowEmptyallow-empty
deprecatedUse clearable instead
When true, an empty color (null) will be allowed as a value. When false, a color value is enforced, and clearing the input or blurring will restore the last valid value.
booleanfalse
alphaChannelalpha-channelWhen true, the component will allow updates to the color's alpha value.booleanfalse
channelsDisabledchannels-disabledWhen true, hides the RGB/HSV channel inputs.booleanfalse
clearableclearableWhen true, an empty color (null) will be allowed as a value. When false, a color value is enforced, and clearing the input or blurring will restore the last valid value.booleanfalse
disableddisabledWhen true, interaction is prevented and the component is displayed with lower opacity.booleanfalse
formatformatThe format of value. When "auto", the format will be inferred from value when set."auto" | "hex" | "hexa" | "hsl" | "hsl-css" | "hsla" | "hsla-css" | "hsv" | "hsva" | "rgb" | "rgb-css" | "rgba" | "rgba-css""auto"
hexDisabledhex-disabledWhen true, hides the hex input.booleanfalse
messageOverridesUse this property to override individual strings used by the component.{ b?: string; blue?: string; deleteColor?: string; g?: string; green?: string; h?: string; hsv?: string; hex?: string; hue?: string; noColor?: string; opacity?: string; r?: string; red?: string; rgb?: string; s?: string; saturation?: string; saveColor?: string; saved?: string; v?: string; value?: string; }
numberingSystemnumbering-systemSpecifies the Unicode numeral system used by the component for localization."arab" | "arabext" | "latn"
savedDisabledsaved-disabledWhen true, hides the saved colors section.booleanfalse
scalescaleSpecifies the size of the component."l" | "m" | "s""m"
storageIdstorage-idSpecifies the storage ID for colors.string
valuevalueThe component's value, where the value can be a CSS color string, or a RGB, HSL or HSV object. The type will be preserved as the color is updated.(HSL & ObjectWithAlpha) | (HSV & ObjectWithAlpha) | (RGB & ObjectWithAlpha) | HSL | HSV | RGB | string

Events

NameDescriptionBehavior
calciteColorPickerChangeFires when the color value has changed.bubblescomposed
calciteColorPickerInputFires as the color value changes. Similar to the calciteColorPickerChange event with the exception of dragging. When dragging the color field or hue slider thumb, this event fires as the thumb is moved.bubblescomposed

Methods

NameDescriptionSignature
componentOnReadyCreate a promise that resolves once component is fully loaded.componentOnReady(): Promise<void>
setFocusSets focus on the component's first focusable element.setFocus(): Promise<void>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close