2
(set-face-attribute 'hl-line nil
                      (cl-case (alist-get 'background-mode (frame-parameters))
                        ('light ; darker percent 5%
                         :background (color-darken-name (face-background 'highlight) 5)
                         )
                        ('dark
                         :background (color-lighten-name (face-background 'default) 3)
                         ))
                      )

The upper code does not work. I hope some one can correct this code.

1 Answer 1

1

The arguments to set-face-attribute after the FRAME arg need to come in pairs.

But you are passing only the new color value, not the pair :background followed by that new color value.

(set-face-attribute 
 'hl-line 
 nil 
 :background    ; <===== THIS WAS MISSING
 (cl-case (alist-get 'background-mode (frame-parameters))
   ('light :background (color-darken-name (face-background 'highlight) 5))
   ('dark :background (color-lighten-name (face-background 'default) 3))))
2
  • Even you said so, but I still don't know how to write this. Can you show me a code? Commented Feb 3, 2017 at 1:06
  • Sorry, because the network delay, your initial answer is not included the code. Commented Feb 3, 2017 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.