mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 18:49:00 +01:00
client: refactor
This commit is contained in:
parent
f079c7aad2
commit
87f1cb23be
@ -26,10 +26,11 @@ function createClassForColor(colorString: string | null) {
|
||||
}
|
||||
|
||||
const className = `color-${color.hex().substring(1)}`;
|
||||
const adjustedColor = adjustColorLightness(color, lightThemeColorMaxLightness!,
|
||||
darkThemeColorMinLightness!);
|
||||
|
||||
if (!registeredClasses.has(className)) {
|
||||
const adjustedColor = adjustColorLightness(color, lightThemeColorMaxLightness!,
|
||||
darkThemeColorMinLightness!);
|
||||
|
||||
$("head").append(`<style>
|
||||
.${className}, span.fancytree-active.${className} {
|
||||
--light-theme-custom-color: ${adjustedColor.lightThemeColor};
|
||||
@ -45,7 +46,6 @@ function createClassForColor(colorString: string | null) {
|
||||
|
||||
function parseColor(color: string) {
|
||||
try {
|
||||
// Parse the given color in the CIELAB color space
|
||||
return Color(color);
|
||||
} catch (ex) {
|
||||
console.error(ex);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user