mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 21:19:01 +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 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);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user