Hapyolor generates beautiful color palettes from an input image and exports it throughout your environment. The goal behind this project, is to create a tool able to pick colors from an image, that are well suited to an editor's colorscheme or a teminal's color profile. In addition, from the palette, the colors should be automatically exported to targets selected by the user.
First of all, if the purpose of those colors is to be used in a terminal or in an editor, they shouldn't be too dark, nor too bright (except for the background or, for some people, the foreground). Then, due to the low number of colors usually needed by the targets (e.g., a terminal's profile only needs sixteen colors), compared to the large number of colors of the original image, it is necessary to filter the colors so that they are not "too close". For instance, if an image has multiple shades of blue, the output should contain hues of blue that are easily distinguishable.
Currently, are supported:
multiplatform:
- Vim
- Lightline
macOS:
- iTerm
Debian and Ubuntu:
- Gnome Terminal
- Rofi
- Yabar
- i3
For more details, The full documentation can be found here.
- python >= 3.5
- imagemagick
- feh (Linux only)
Debian or Ubuntu:
sudo apt-get update && sudo apt-get install python3 python3-pip imagemagick feh -y
macOS:
With homebrew:
brew install python3 python3-pip imagemagick
Hapycolor can be installed with pip
, or by cloning this repository.
pip3 install hapycolor
git clone https://github.com/rvdz/hapycolor
cd hapycolor
pip3 install . --user
For basic usage, execute:
hapycolor -f <path/to/file>
The full documentation of Hapycolor's cli can be found by running:
hapycolor --help
Gnome Terminal might not load the generated profile at first. In that case:
- Create a new profile called 'Default', and switch to it
- OR run:
dconf reset -f /org/gnome/terminal/legacy/profiles:/
If one of the above solutions does not work for you (Debian 9, Gnome shell 3.22 for instance), try doing both by reseting first.
## Test To run the tests locally, excute:
python3 setup.py test