Skip to main content
Elastic UI
Elastic UI
Getting startedComponentsPatternsContentData visualization
EUI ChangelogGitHubFigma
  • Setup
  • Theming
  • Accessibility
  • Testing
  • Utilities
    • Accessibility
    • Auto sizer
    • Color palettes
    • Copy
    • CSS utility classes
    • Delay
    • Error boundary
    • Focus trap
    • Highlight and mark
    • HTML ID generator
    • I18n
    • Inner text
    • Mutation observer
    • Outside click detector
    • Overlay mask
    • Portal
    • Pretty duration
    • Provider
    • Resize observer
    • Scroll
    • Text diff
    • Text truncation
    • Window events
  • EUI
  • Utilities
  • Color palettes

Color palettes

EUI provides a base set of color palettes that return an array of hexadecimal color for use in other EUI components or charts.

Preset qualitative palettes

Qualitative palettes are best suited for communicating and comparing discrete data series. EUI recommends using the

euiPaletteColorBlind() for qualitative and categorical data.

This palette is restricted to only 10 colors. However, you can add more groups of 10 which are alternates of the original. This is better than allowing the initial set to loop.

These colors are meant to be used as graphics and contrasted against the value of euiColorEmptyShade for the current theme. When placing text on top of these colors, use the euiPaletteColorBlindBehindText() variant. It is a brightened version of the base palette to create better contrast with text.

Loading...

Recommended quantitative palettes

Quantitative palettes are best suited for displaying data on a continuum, as in the case of health statuses and large geographic or demographic-based data sets.

EUI provides the following common palettes for quantitative data and

charts. Just pass in the number of steps needed and the function will interpolate between the colors.

The palette for status is the only palette that has proper contrast ratios. When using the other palettes, consider adding another form of the data for screen readers.

Loading...

Custom palettes

Use the colorPalette service to generate a custom, gradiated palette array of any length from one or more hexadecimal color codes. The third parameter divergent, will interpolate between the two halves of the spectrums separately. If a middle point is not provided, it will graduate to light gray.

Loading...

Props

euiPaletteColorBlind

𐘂𐘂
✄𐘗✄𐘗
Prop
↦
Description and type
↦
Default value
↵
Prop
colors#
↦
Description and type

Defines the default set of colors the palette uses.
Defaults to vis colors from EUI_VIS_COLOR_STORE.
Use this to specify colors when you can't rely on the EuiProvider updates.

Type: _EuiThemeVisColors
↦
Default value
↵
Prop
hasVisColorAdjustment#
↦
Description and type

Specifies if some color asdjustments for vis colors are required.
Has to be passed when colors are set

Type: boolean
↦
Default value
↵
Prop
rotations#
↦
Description and type

How many variations of the series is needed

Type: number
↦
Default value
1
↵
Prop
order#
↦
Description and type

Order similar colors as groups or just append each variation

Type: "append" | "group"
↦
Default value
append
↵
Prop
direction#
↦
Description and type

Specifies if the direction of the color variations

Type: "lighter" | "darker" | "both"
↦
Default value
lighter
↵
Prop
sortBy#
↦
Description and type

Use the default sort order, or re-sort them based on the color wheel (natural)

Type: "default" | "natural"
↦
Default value
default
↵
Prop
sortShift#
↦
Description and type

Shift the sorting order by a certain number when used in conjunction with 'natural' sortBy.
Defaults to a number close to green.

Type: string
↦
Default value
-100
↵
𐘂𐘂
Edit this page

Previous
Auto sizer
Next
Copy
  • Preset qualitative palettes
  • Recommended quantitative palettes
  • Custom palettes
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic