Version 1.0.1

Color area

A color area allows users to visually select two properties of a color simultaneously. It's commonly used together with a color slider or color wheel.

An example of color area as part of a color picker being used to set a fill color along with a color gradient slider, transparency slider, and text field for manual color entry.An example of color area as part of a color picker being used to set a fill color along with a color gradient slider, transparency slider, and text field for manual color entry.

Anatomy#


Image illustrating through labels the component parts of a color area, including its background, handle, and loupe.

Options#


Key example of color area with the width annotated with customizable.

Width#

The width of a color area can be customized appropriately for its context. By default, the width of a color area is size-2400 (192 px on desktop and 240 px on mobile).

Key example of color area with height annotated with customizable.

Height#

The height of a color area can be customized appropriately for its context. By default, the height of a color area is size-2400 (192 px on desktop and 240 px on mobile).

Behaviors#


Key example of two color areas demonstrating the handle at different positions.

Handle behavior#

The color area’s handle can slide all the way over the edge of the area. It always displays the selected color inside the handle and never gets cut off by the border or any container.

Key example of a color area demonstrating the loupe relative to the handle and finger position.

Loupe behavior (down state, finger input)#

On down (touch), a loupe appears above the handle to show the selected color that would otherwise be covered by the finger. This only appears on finger input, not mouse or stylus. It appears 10 px above the edge of the handle on desktop scale and 8 px on mobile scale.

Usage guidelines#


Display color selection#

When using color areas, it’s important to clearly display the color selection in real-time. It can be in a color swatch, or directly on the canvas, or both.

A key example of a color swatch above color area, color slider, and transparency slider components correctly representing their combined values.

Keyboard interactions#


KeyInteraction
TabPlaces focus on the handle. If the handle is already in focus, moves focus to the next element in the page tab sequence.
Shift + TabPlaces focus on the previous element in the page tab sequence.
Up, Down, Left, or Right ArrowMoves the handle up/down/left/right.

Changelog#


DateNumberNotes
Mar 26, 20201.0.1
  • Updated handle border transparency to meet minimum contrast ratio
Apr 19, 20191.0.0
  • This component has been included to the website.

Design checklist#


All interactive states

Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).

N/A

Multiple options

Includes relevant options (variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.)

All color themes

Works properly across all four color themes (lightest, light, dark, darkest).

All platform scales

Includes a desktop scale (UWP, macOS, web desktop) and a mobile scale (iOS, Android, web mobile).

Defined behaviors

Includes guidelines for layout (wrapping, truncation, overflow), animation, interactions, etc.

Usage guidelines

Includes a list of dos and don’ts that highlight best practices and common mistakes.

Accessible contrast

Follows WCAG 2.0 standards for contrast (AA).

N/A

Internationalization guidelines

Works properly across various locales and includes guidelines for bi-directionality (RTL).

Keyboard interactions

Follows WCAG 2.0 standards for keyboard accessibility guidelines and includes a description of the keyboard interactions.

Generated UI kit

Includes a downloadable XD file that has been generated by code and shows multiple variations, states, color themes, and scales.

Design tokens

All design attributes (color, typography, layout, animation, etc.) are included in Spectrum DNA.