mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-15 04:09:14 +00:00
feat: enhance the Dark Theme (#336)
This commit is contained in:
@@ -130,3 +130,43 @@ export const RespFields: Indexable = {
|
||||
error
|
||||
}`,
|
||||
};
|
||||
|
||||
export const DarkChartColors = [
|
||||
"#79bbff",
|
||||
"#a0a7e6",
|
||||
"#30A4EB",
|
||||
"#45BFC0",
|
||||
"#ebbf93",
|
||||
"#884dde",
|
||||
"#1bbf93",
|
||||
"#7289ab",
|
||||
"#f56c6c",
|
||||
"#81feb7",
|
||||
"#4094fa",
|
||||
"#ff894d",
|
||||
"#884dde",
|
||||
"#ebbf93",
|
||||
"#fedc6d",
|
||||
"#da7cfa",
|
||||
"#b88230",
|
||||
"#a0cfff",
|
||||
];
|
||||
|
||||
export const LightChartColors = [
|
||||
"#3f96e3",
|
||||
"#a0a7e6",
|
||||
"#45BFC0",
|
||||
"#FFCC55",
|
||||
"#FF6A84",
|
||||
"#c23531",
|
||||
"#2f4554",
|
||||
"#61a0a8",
|
||||
"#d48265",
|
||||
"#91c7ae",
|
||||
"#749f83",
|
||||
"#ca8622",
|
||||
"#bda29a",
|
||||
"#6e7074",
|
||||
"#546570",
|
||||
"#c4ccd3",
|
||||
];
|
||||
|
@@ -16,6 +16,9 @@
|
||||
*/
|
||||
import type { LegendOptions } from "@/types/dashboard";
|
||||
import { isDef } from "@/utils/is";
|
||||
import { DarkChartColors, LightChartColors } from "./data";
|
||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||
import { Themes } from "@/constants/data";
|
||||
|
||||
export default function useLegendProcess(legend?: LegendOptions) {
|
||||
let isRight = false;
|
||||
@@ -96,37 +99,11 @@ export default function useLegendProcess(legend?: LegendOptions) {
|
||||
|
||||
return { source, headers };
|
||||
}
|
||||
function chartColors(keys: string[]) {
|
||||
let color: string[] = [];
|
||||
switch (keys.length) {
|
||||
case 2:
|
||||
color = ["#FF6A84", "#a0b1e6"];
|
||||
break;
|
||||
case 1:
|
||||
color = ["#3f96e3"];
|
||||
break;
|
||||
default:
|
||||
color = [
|
||||
"#30A4EB",
|
||||
"#45BFC0",
|
||||
"#FFCC55",
|
||||
"#FF6A84",
|
||||
"#a0a7e6",
|
||||
"#c23531",
|
||||
"#2f4554",
|
||||
"#61a0a8",
|
||||
"#d48265",
|
||||
"#91c7ae",
|
||||
"#749f83",
|
||||
"#ca8622",
|
||||
"#bda29a",
|
||||
"#6e7074",
|
||||
"#546570",
|
||||
"#c4ccd3",
|
||||
];
|
||||
break;
|
||||
}
|
||||
return color;
|
||||
function chartColors() {
|
||||
const appStore = useAppStoreWithOut();
|
||||
const list = appStore.theme === Themes.Dark ? DarkChartColors : LightChartColors;
|
||||
|
||||
return list;
|
||||
}
|
||||
return { showEchartsLegend, isRight, aggregations, chartColors };
|
||||
}
|
||||
|
Reference in New Issue
Block a user