diff options
author | crupest <crupest@outlook.com> | 2021-06-29 23:50:55 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-29 23:50:55 +0800 |
commit | de7df0e4fb38863b830a104a5a38d0e5247679f8 (patch) | |
tree | 2c758dcf807bc8aa876152b5afc7aa03c61295ec /FrontEnd/src/palette.ts | |
parent | 5c0dc840fa4af43fdb7ae5f93f462cd63c74bc6d (diff) | |
download | timeline-de7df0e4fb38863b830a104a5a38d0e5247679f8.tar.gz timeline-de7df0e4fb38863b830a104a5a38d0e5247679f8.tar.bz2 timeline-de7df0e4fb38863b830a104a5a38d0e5247679f8.zip |
...
Diffstat (limited to 'FrontEnd/src/palette.ts')
-rw-r--r-- | FrontEnd/src/palette.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/FrontEnd/src/palette.ts b/FrontEnd/src/palette.ts index fa99364f..fb54f042 100644 --- a/FrontEnd/src/palette.ts +++ b/FrontEnd/src/palette.ts @@ -36,6 +36,8 @@ const paletteColorList = [ "secondary", "text-primary", "text-on-primary", + "text-on-primary-enhance", + "text-on-secondary", "danger", "success", ] as const; @@ -98,6 +100,12 @@ export function generatePalette(options: { "text-on-primary": generatePaletteColor( p.lightness() > 60 ? "black" : "white" ), + "text-on-primary-enhance": generatePaletteColor( + pe.lightness() > 60 ? "black" : "white" + ), + "text-on-secondary": generatePaletteColor( + s.lightness() > 60 ? "black" : "white" + ), danger: generatePaletteColor("red"), success: generatePaletteColor("green"), }; @@ -108,7 +116,7 @@ export function generatePaletteCSS(palette: Palette): string { for (const colorType of paletteColorList) { const paletteColor = palette[colorType]; for (const variant in paletteColor) { - let key = `--tl-${colorType}`; + let key = `--cru-${colorType}`; if (variant !== "color") key += `-${variant}`; key += "-color"; colors.push([key, paletteColor[variant]]); @@ -122,8 +130,8 @@ export function generatePaletteCSS(palette: Palette): string { const paletteSubject: BehaviorSubject<Palette | null> = new BehaviorSubject<Palette | null>( - // generatePalette({ primary: "rgb(0, 123, 255)" }) - null + generatePalette({ primary: "rgb(0, 123, 255)" }) + // null ); export const palette$: Observable<Palette | null> = |