KMahoney / kpm-list

An Emacs buffer list
BSD 2-Clause "Simplified" License
20 stars 3 forks source link

Nord theme for kpm-list #8

Open TRSx80 opened 4 years ago

TRSx80 commented 4 years ago

Hallo,

First off, thanks for sharing this, it's really useful! I use it all the time for a couple years now, I don't know what I would do without it! :beers:

I was on Solarized Dark for a long time, then recently stumbled across (and switched to) Nord theme which I really like! Nord supports just about everything I need (Emacs, terminal, GTK, etc.) in a nice and consistent way, but there was one thing standing out, and that quite glaringly... :smile: Well, in relation to how Nord looks, anyway.

Now I am no Emacs theming expert to be sure, and certainly no artist, but the palette and guidelines are pretty easy to follow (Nord creator deserves most the credit for picking (what are IMHO) really great color combos), and so tonight I spent a little time and came up with something I thought was workable:

2020-04-16_024024_screenshot_from_hal5_sanitized

Again, I am not even sure I did this "properly" (any Emacs theming tips are welcomed!) but I got it to work by putting the following in my Emacs init to override the defaults.

It's not too much trouble for me to share it here now, in the same spirit that I found this software was shared with me, on the off chance someone else happens along with same requirements (how small do you think is the Venn diagram union between kpm-list and Nord theme users anyway?). :smile:

Of course you can set the colors directly by hex value, but I find this way of aliasing them easier to work with. Especially when "playing around" and tweaking things. Just make sure you assign the color palette variables (nord0...16) earlier on in the init loading then when you need to use them (in case you end up using them in multiple places to override other things as well, like I do).

And so, without further ado:

  ;; Ripped from:
  ;; https://github.com/arcticicestudio/nord-vim/blob/develop/colors/nord.vim
  ;; as it was most faithful (that I found in 5 second search ;) ) to:
  ;; https://www.nordtheme.com/docs/colors-and-palettes
  ;; whilst having easiest format to modify to my needs

  ;; Dark Backgrounds "Polar Night"
  (setq nord0 "#2E3440") ; darkest
  (setq nord1 "#3B4252")
  (setq nord2 "#434C5E")
  (setq nord3 "#4C566A") ; lightest

  ;; Light Backgrounds "Snow Storm"
  (setq nord4 "#D8DEE9") ; darkest
  (setq nord5 "#E5E9F0")
  (setq nord6 "#ECEFF4") ; lightest

  ;; Heart Palette (bluish colors) "Frost"
  (setq nord7 "#8FBCBB") ; lightest / highest contrast
  (setq nord8 "#88C0D0") ; primary UI elements
  (setq nord9 "#81A1C1") ; secondary UI elements
  (setq nord10 "#5E81AC") ; darkest / lowest contrast, tertiary

  ;; Colorful Accents "Aurora"
  (setq nord11 "#BF616A") ; reddish
  (setq nord12 "#D08770") ; orangeish
  (setq nord13 "#EBCB8B") ; yellowish
  (setq nord14 "#A3BE8C") ; greenish
  (setq nord15 "#B48EAD") ; purpleish

  (set-face-attribute 'kpm-list-buffer-face nil
              :foreground nord4)

  (set-face-attribute 'kpm-list-buffer-highlight-face nil
              :foreground nord14)

  (set-face-attribute 'kpm-list-directory-face nil
              :foreground nord8)

  (set-face-attribute 'kpm-list-header-face nil
              :background nord1
              :foreground nord7)

  (set-face-attribute 'kpm-list-mode-face nil
              :foreground nord7)

  (set-face-attribute 'kpm-list-modified-face nil
              :foreground nord11)

  (set-face-attribute 'kpm-list-old-path-face nil
              :foreground nord10)

Cheers! :beers:

TRSx80 commented 4 years ago

Hi @KMahoney,

I am still pretty new to Emacs theming, but something that occurred to me while working on this was that perhaps the better approach would be to change kpm-list to use the "default alias" (for lack of a better term, I don't know what they are really called [1] ) font face names in Emacs, instead of separate hard coded ones. But perhaps you have some reasoning behind your choices that I am unaware of?

I only changed themes a couple times in the last few years, but kpm-list (unlike most other packages) always seemed to stick out with it's own color scheme, instead of picking up the one I had overall set for Emacs.

Since @arcticicestudio got back to me in the thread I made over there at Nord theme, I suppose I might be circling back to this at some point (and perhaps eventually submitting a PR into Nord, etc.). So I wanted to ping you and get your thoughts on this.

[1] I am talking about the ones that are named like:

font-lock-keyword-face
font-lock-string-face

etc.

Or, in case of directory font, we could use the default:

dired-directory

font-lock face. And then maybe re-map some of the others to appropriate kpm-list faces.

If you didn't know already, you can see all of these (and more, in fact all faces I think) by doing M-x list-faces-display.

I think this would be a more general solution, which would not only work well for Nord, but any other user chosen theme as well.

What do you think?