mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05:00
change pie gradient to from colors
This commit is contained in:
@@ -30,6 +30,7 @@ import { css } from '@emotion/css';
|
|||||||
import { useComponentInstanceId } from '@grafana/ui/src/utils/useComponetInstanceId';
|
import { useComponentInstanceId } from '@grafana/ui/src/utils/useComponetInstanceId';
|
||||||
import { getTooltipContainerStyles } from '@grafana/ui/src/themes/mixins';
|
import { getTooltipContainerStyles } from '@grafana/ui/src/themes/mixins';
|
||||||
import { selectors } from '@grafana/e2e-selectors';
|
import { selectors } from '@grafana/e2e-selectors';
|
||||||
|
import { darken, lighten } from '@grafana/data/src/themes/colorManipulator';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @beta
|
* @beta
|
||||||
@@ -344,17 +345,11 @@ function getLabelPos(arc: PieArcDatum<FieldDisplay>, outerRadius: number, innerR
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getGradientColorFrom(color: string, theme: GrafanaTheme2) {
|
function getGradientColorFrom(color: string, theme: GrafanaTheme2) {
|
||||||
return tinycolor(color)
|
return theme.isDark ? darken(color, 0.3) : lighten(color, 0.3);
|
||||||
.darken(20 * (theme.isDark ? 1 : -0.7))
|
|
||||||
.spin(8)
|
|
||||||
.toRgbString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGradientColorTo(color: string, theme: GrafanaTheme2) {
|
function getGradientColorTo(color: string, theme: GrafanaTheme2) {
|
||||||
return tinycolor(color)
|
return theme.isDark ? darken(color, 0.1) : lighten(color, 0.1);
|
||||||
.darken(10 * (theme.isDark ? 1 : -0.7))
|
|
||||||
.spin(-8)
|
|
||||||
.toRgbString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PieLayout {
|
interface PieLayout {
|
||||||
|
|||||||
Reference in New Issue
Block a user