(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)
                         :background (color-lighten-name (face-background 'default) 3)

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


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.

 :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))))
  • Even you said so, but I still don't know how to write this. Can you show me a code? Feb 3 '17 at 1:06
  • Sorry, because the network delay, your initial answer is not included the code. Feb 3 '17 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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