jcaw / theme-magic

🎨 Apply your Emacs theme to the rest of Linux, using magic. Also works on Mac.
GNU General Public License v3.0
141 stars 4 forks source link

Feature: import colors from Pywal #10

Open jcaw opened 5 years ago

jcaw commented 5 years ago

Pywal automatically extracts colors from a wallpaper, and applies them to your current Linux session wherever it can (mainly, terminals). theme-magic exports colors, but it can't currently import them.

Add some method for importing Pywal colors, and turning them into a nice theme.

jcaw commented 5 years ago

Working on this on branch wal-theme-template.

The approach I'm taking is to create a theme that takes 16 colors as input, and generates intermediate colors each time it's loaded. The core theme is adapted from the spacemacs themes, because they have comprehensive coverage and follow easily understandable design patterns. Hopefully, these patterns should be generalisable.

Theoretically, this could eventually be refactored into a general Emacs theme generator.

Currently, the theme is minimally functional. Colors haven't been tweaked yet. This is an example of what is currently generated, using a test palette:

wal-template-preliminary-test

Permalink to the state at this point.

jcaw commented 5 years ago

The theme now extracts colors automatically from Pywal's cache when it's reloaded. There's no error handling (currently). It will fail if Pywal has no cached theme.

Now that importing is automatic, here are a few more test runs:

2019-05-06_08-01-53__May-06

2019-05-06_08-05-03__May-06

2019-05-06_08-05-48__May-06

Playing with some different themes, the current method doesn't do so well with light themes. This will need to be tweaked.

Permalink here.

jcaw commented 5 years ago

Update: here's how the colors look now. Subtle changes, but I think they look much better.

2019-05-07_08-36-00__May-07

2019-05-07_08-36-47__May-07

2019-05-07_09-04-59__May-07

2019-05-07_09-06-08__May-07

elsehow commented 3 years ago

@jcaw This is great! Any plans to merge this into master?