deviantfero / wpgtk

:flower_playing_cards: a colorscheme, wallpaper and template manager for *nix
http://deviantfero.github.io/wpgtk/
GNU General Public License v2.0
2.06k stars 49 forks source link

Reddit followup: Help make generated color schemes adhere to readability rules #99

Closed pascalwhoop closed 6 years ago

pascalwhoop commented 6 years ago

Hi, you asked me to issue this here and who can say no to such a responsive dev.

Solarized is the godfather of custom terminal colors. It's following many rules that allow for readability and help developers to subconsciously work more efficiently. It also offers a dark and a light variant which barely change the colors. That's some serious craftmanship.

As a start, it would be great if wpgtk allows us to define a pattern that defines what colors are expected at which spot. If wpgtk generates 14 colors from the wallpaper, it would be nice to have it adhere to a ruleset where certain colors are always placed in certain spots. I believe going with solarized is a save bet here.

[urxvt solarized] (https://gist.github.com/yevgenko/1167205) is probably a good guideline. Alternatively, the original vim colors for solarized.

First idea: Take the generated colors and instead of sorting them from dark -> light or blue -> red or whatever ordering is followed, place each color in the spot that matches the solarized color in that spot the closest. So because

!! green dark/light
*color2: #859900

is set in solarized, the color that is closest to #859900 is defined as color2. This could be enabled with a --solarizing flag to not force everyone to use this.

pascalwhoop commented 6 years ago

https://stackoverflow.com/questions/14168456/python-how-to-sort-a-list-of-colors-based-on-a-colors-distance-from-a-sourc#14168486 color distances, in case you don't already know how to do it.

deviantfero commented 6 years ago

I can think of something like:

The color that is redisher goes in spot color1 and color9, where the red would normally go, and so on (with green, blue, cyan, etc). the thing is that when the colorscheme is to monocromatic, it would still be unreadable, but it would definetly be a nice start.

I'll keep this in mind for the next release.

in the mean time, you can use the "shuffle sort" in wpgtk to try and get some kind of logical order out of the colorscheme, that's what I currently do.

you also mention solarized, you can use preset themes in wpgtk with wpg --pywal [theme], leaving it empty will give you a list of possible themes, one of which is solarized, you can also import themes with wpg -i [wallpaper] [theme.json], this supports terminal.sexy format. Give it a whirl wpg --pywal base16-solarized, you can proceed to edit the theme afterwards.

I don't want to add a new dependency to wpgtk so I'll probably try to implement it with color cordinates such as hls, or something like that.

deviantfero commented 6 years ago

hey, you can check an update on this in #105

deviantfero commented 6 years ago

Hi, this PR has been merged and the functionality is out in version 5.7.0, if you feel this is somehow not enough please feel free to open a new issue!