kibana/x-pack/plugins/apm/common/viz_colors.ts
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00

29 lines
788 B
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import lightTheme from '@elastic/eui/dist/eui_theme_light.json';
function getVizColorsForTheme(theme = lightTheme) {
return [
theme.euiColorVis0,
theme.euiColorVis1,
theme.euiColorVis2,
theme.euiColorVis3,
theme.euiColorVis4,
theme.euiColorVis5,
theme.euiColorVis6,
theme.euiColorVis7,
theme.euiColorVis8,
theme.euiColorVis9,
];
}
export function getVizColorForIndex(index = 0, theme = lightTheme) {
const colors = getVizColorsForTheme(theme);
return colors[index % colors.length];
}