Heatmap: fix color scheme reversal (#56227) (#56234)

(cherry picked from commit eeb31c2901)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot) 2022-10-04 09:31:46 +02:00 committed by GitHub
parent 6c38c502a9
commit 6e680cac8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,13 +97,16 @@ export function quantizeScheme(opts: HeatmapColorOptions, theme: GrafanaTheme2):
}
if (
opts.reverse ||
scheme.invert === 'always' ||
(scheme.invert === 'dark' && theme.isDark) ||
(scheme.invert === 'light' && theme.isLight)
) {
palette.reverse();
}
if (opts.reverse) {
palette.reverse();
}
}
return palette;