mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-24 23:07:25 +08:00
style: use theme color for chart gridlines
this makes sure that they are always visible
This commit is contained in:
parent
1d4d7dab87
commit
9779c70acd
1 changed files with 6 additions and 0 deletions
|
|
@ -1084,10 +1084,13 @@ async function updateColors<
|
|||
>(chart: ChartWithUpdateColors<TType, TData, TLabel>): Promise<void> {
|
||||
const bgcolor = await ThemeColors.get("bg");
|
||||
const subcolor = await ThemeColors.get("sub");
|
||||
const subaltcolor = await ThemeColors.get("subAlt");
|
||||
const maincolor = await ThemeColors.get("main");
|
||||
const errorcolor = await ThemeColors.get("error");
|
||||
const textcolor = await ThemeColors.get("text");
|
||||
|
||||
const gridcolor = Misc.blendTwoHexColors(bgcolor, subaltcolor, 0.75);
|
||||
|
||||
//@ts-ignore
|
||||
chart.data.datasets[0].borderColor = (ctx): string => {
|
||||
const isPb = ctx.raw?.["isPb"];
|
||||
|
|
@ -1199,6 +1202,9 @@ async function updateColors<
|
|||
const axis = chartScaleOptions.scales[scaleID] as CartesianScaleOptions;
|
||||
axis.ticks.color = subcolor;
|
||||
axis.title.color = subcolor;
|
||||
axis.grid.color = gridcolor;
|
||||
axis.grid.tickColor = gridcolor;
|
||||
axis.grid.borderColor = gridcolor;
|
||||
});
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue