aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/palette.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-06-16 20:05:34 +0800
committercrupest <crupest@outlook.com>2021-06-16 20:05:34 +0800
commit6328d3eddd50f467921f8eb029937523be203b74 (patch)
tree047b131562b12b94ee84cab886c990ad857ba482 /FrontEnd/src/palette.ts
parent8b0b103859ad869021361de6090cbebff0574cdb (diff)
downloadtimeline-6328d3eddd50f467921f8eb029937523be203b74.tar.gz
timeline-6328d3eddd50f467921f8eb029937523be203b74.tar.bz2
timeline-6328d3eddd50f467921f8eb029937523be203b74.zip
fix: Fix #624.
Diffstat (limited to 'FrontEnd/src/palette.ts')
-rw-r--r--FrontEnd/src/palette.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/FrontEnd/src/palette.ts b/FrontEnd/src/palette.ts
index 767fe995..da1e133f 100644
--- a/FrontEnd/src/palette.ts
+++ b/FrontEnd/src/palette.ts
@@ -36,13 +36,12 @@ export type Palette = Record<PaletteColorType, PaletteColor>;
export function generatePaletteColor(color: string): PaletteColor {
const c = Color(color);
return {
- color: c.toString(),
- inactive: (c.lightness() > 60
- ? darkenBy(c, 0.1)
- : lightenBy(c, 0.1)
- ).toString(),
- lighter: lightenBy(c, 0.1).toString(),
- darker: darkenBy(c, 0.1).toString(),
+ color: c.rgb().toString(),
+ inactive: (c.lightness() > 60 ? darkenBy(c, 0.1) : lightenBy(c, 0.1))
+ .rgb()
+ .toString(),
+ lighter: lightenBy(c, 0.1).rgb().toString(),
+ darker: darkenBy(c, 0.1).rgb().toString(),
};
}
@@ -84,7 +83,7 @@ export function generatePaletteCSS(palette: Palette): string {
}
}
- return `:root {${colors
+ return `html {${colors
.map(([key, color]) => `${key} : ${color};`)
.join("")}}`;
}