mirror of
				https://github.com/larstvei/Focus.git
				synced 2025-11-04 02:00:11 +00:00 
			
		
		
		
	Simplify making a unfocused face
This commit is contained in:
		
							parent
							
								
									6f7fbd3513
								
							
						
					
					
						commit
						872f24cb26
					
				
							
								
								
									
										8
									
								
								focus.el
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								focus.el
									
									
									
									
									
								
							@ -142,13 +142,13 @@ The timer calls `focus-read-only-hide-cursor' after
 | 
				
			|||||||
(defun focus-make-unfocused-face (fg)
 | 
					(defun focus-make-unfocused-face (fg)
 | 
				
			||||||
  "Add dimmed foreground color FG to the `focus-unfocused` face."
 | 
					  "Add dimmed foreground color FG to the `focus-unfocused` face."
 | 
				
			||||||
  (let ((bg (face-background 'default)))
 | 
					  (let ((bg (face-background 'default)))
 | 
				
			||||||
    (when (and fg bg (color-defined-p fg) (color-defined-p bg))
 | 
					    (if (and fg bg (color-defined-p fg) (color-defined-p bg)
 | 
				
			||||||
      (if (color-defined-p (face-attribute 'focus-unfocused :foreground))
 | 
					             (not (color-defined-p (face-attribute 'focus-unfocused :foreground))))
 | 
				
			||||||
          'focus-unfocused
 | 
					 | 
				
			||||||
        (plist-put (face-attr-construct 'focus-unfocused)
 | 
					        (plist-put (face-attr-construct 'focus-unfocused)
 | 
				
			||||||
                   :foreground (focus-lerp (color-name-to-rgb fg)
 | 
					                   :foreground (focus-lerp (color-name-to-rgb fg)
 | 
				
			||||||
                                           (color-name-to-rgb bg)
 | 
					                                           (color-name-to-rgb bg)
 | 
				
			||||||
                                           focus-fraction))))))
 | 
					                                           focus-fraction))
 | 
				
			||||||
 | 
					      'focus-unfocused)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defun focus-foreground-from-face (face)
 | 
					(defun focus-foreground-from-face (face)
 | 
				
			||||||
  "Return foreground color for FACE, or 'default if nil."
 | 
					  "Return foreground color for FACE, or 'default if nil."
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user