Intro

The color picker allows users to choose any color and provides different input options for selecting colors.

Picture

Color picker

When to Use

Do

Use the color picker:

  • To let users select any color freely.

Don't

Don’t use the color picker:

  • If you want to let users select one color from a predefined set of colors. Use the color palette instead.
  • If you want to let users select one color from a predefined set of colors, with the additional option of defining their own colors. Use the color palette popover instead.

Anatomy

  1. Color Picker Container: Sets up lightness and saturation.
  2. Sliders:
    2a) Modifies the hue
    2b) Modifies the transparency (“alpha channel”)
  3. Comparison Color Fields: Display the current and new color settings.
  4. Hex Input: Sets the color as a hexadecimal value.
  5. Color Mode Panel: C onsists of HSL(A) / RGB(A) Inputs
  6. Color Mode Switching Button

Picture

Anatomy of the color picker

Types

Default Color Picker

The default color picker offers full color customization, including support for transparency (alpha channel). It provides two sets of input controls:

  • Red / Green / Blue / Alpha (RGBA)
  • Hue / Saturation / Lightness / Alpha (HSLA)

Users can switch between the RGBA and HSLA input modes, depending on their preference or the requirements of the task. This version of the color picker is suitable for advanced use cases, where precise color and transparency control is needed.

Picture

Default color picker

Simplified Color Picker

The simplified color picker provides controls for adjusting hue, saturation, and lightness. Unlike the default color picker, it doesn’t include an alpha (transparency), RGB or HSL setting.

The simplified color picker displays both the current color and the newly selected color, allowing the user to easily compare changes. This component is intended for use cases where a more focused and minimal color selection is needed, without the complexity of full RGBA or hexadecimal input options.

Picture

Simplified color picker

Behavior and Interaction

Picking a Color in the Color Picker Box

The color picker box enables users to select a color by moving the color picking circle within the box. Moving the circle vertically adjusts the hue or saturation, while horizontal movement changes the brightness or lightness.

This interaction allows for precise control over the selected color by navigating through a continuous gradient of shades and tones.

Picture

Picking a color in the color picker box

Setting a Hue and Transparency

The hue slider enables users to select a base color by dragging the handle horizontally across the full color spectrum.

The transparency slider adjusts the opacity level of the selected color, where movement from left to right typically increases opacity.

Picture

Setting a hue and transparency in the color picker

Picking a Color with the HSL(A) / RGB(A) Inputs

Colors can also be selected by entering values directly into the HSL(A), RGB(A), or Hex input fields. If a user enters a value outside the valid range, it is automatically adjusted to the nearest allowed value. For example, values above 255 in RGB inputs are set to 255, and values above 360 in the hue (H) input are set to 360. Negative values are adjusted to 0.

Picture

Picking a color with the HSL(A) / RGB(A) Inputs

Changing the Color Format

The color picker allows users to switch between RGB and HSL color formats by clicking on the arrow buttons. Changing the format updates the input fields accordingly, while preserving the currently selected color.

Picture

Changing the color format

Responsive Behavior

The color picker supports cozy and compact content densities.

Components

Implementation

Specifications

Components

Implementation