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