theme-magic icon indicating copy to clipboard operation
theme-magic copied to clipboard

Feature: import colors from Pywal

Open jcaw opened this issue 5 years ago • 4 comments

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 avatar May 06 '19 14:05 jcaw

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 avatar May 06 '19 14:05 jcaw

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 avatar May 06 '19 15:05 jcaw

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

jcaw avatar May 07 '19 16:05 jcaw

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

elsehow avatar Sep 28 '21 00:09 elsehow