Skip to content

Pywal-like color palette generator, but faster and in C

License

Notifications You must be signed in to change notification settings

danihek/hellwal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hellwal - Fast, Extensible Color Palette Generator

Preview

Installation

  1. To install from AUR, run:
yay -S hellwal
  1. You can also install hellwal from nixpkgs unstable:
environment.systemPackages = [
  pkgs.hellwal
];

Building

Clone git repo, run make command and you are ready to go! - you just need C compiler and gnumake!

git clone https://github.com/danihek/hellwal && cd hellwal && make

How to use?

Run this with your wallpaper image:

hellwal -i [image]

You can also randomly pick image from given directory like this:

hellwal -i <folder> --random

Generated, templates are saved in ~/.cache/hellwal/ directory.

Templates

[INFO] - if you got hellwal from AUR, examples of default templates are stored in /usr/share/docs/

Look up for templating examples in templates folder, they look more-less like this:

# Main
background='%%background%%'
foreground='%%foreground%%'

# Path
wallpaper_path='%%wallpaper%%'

# Colors
color0='%%color0.hex%%'
color1='%%color1.hex%%'

# ... and so on and so fourth.

color15='%%color15.hex%%'


# RGB
backgroundRGB='%%background.rgb%%'
foregroundRGB='%%foreground.rgb%%'

color15butRGB='%%color15.rgb%%'

You can get any generated color between 0-15 values. By writing '.' after keyword you can specify type: hex or rgb. If you havent specify this output of template will be in hex.

Available color template formats:

Type Input Output
hex color0.hex 000000
rgb color0.rgb 0, 0, 0

JSON

You can use --jsonargument to suppress any other output and write colors to stdout in json format. It's easy to do something with it with jq later. For example:

hellwal -i [wallpaper] --json | jq '.'

Themes

You can set your own theme, re-run it anytime and apply to your config or other programs! It can be previously generated palette from image, gruvbox, tokyonight or anything you want! For example gruvbox theme:

%% color0  = #282828 %%
%% color1  = #cc241d %%
%% color2  = #98971a %%
%% color3  = #d79921 %%
%% color4  = #458588 %%
%% color5  = #b16286 %%
%% color6  = #689d6a %%
%% color7  = #a89984 %%
%% color8  = #928374 %%
%% color9  = #fb4934 %%
%% color10 = #b8bb26 %%
%% color11 = #fabd2f %%
%% color12 = #83a598 %%
%% color13 = #d3869b %%
%% color14 = #8ec07c %%
%% color15 = #ebdbb2 %%

Save text above as file or take from this repo gruvbox and just run hellwal:

hellwal --theme ./themes/gruvbox.hellwal

I recommend to put all themes to ~/.config/hellwal/themes folder, because from there you can just provide theme name, and it will pick it up automatically, without specifying path. Of course if you want, you can also set different theme-folder path. For example:

hellwal -t gruvbox.hellwal --theme-folder ~/dotfiles/configs/hellwal/themes

NEON Mode

Neon mode boosts colors to make them look more neon-like, sometimes it's pain in the EYE, but usually it looks better. Turned off by default.

hellwal -i [wallpaper] --neon-mode

Modes

You can select -d and --dark or -l and --light mode on every given image, theme etc, no matter if it's generated from image or from theme file. Also there is --color mode.

Dark mode (on by default)

hellwal -i [wallpaper] --dark

Light mode

hellwal -i [wallpaper] --light

color mode (crazyy one)

hellwal -i [wallpaper] --color

The best thing about it is that you are able to combine all of them together. Usually it's not a good idea, but sometimes you can achieve some crazy combination of colors!

hellwal -i [wallpaper] --color --light --dark

Also you have couple of cool arguments to manipulate how colors will be computed:

  • you can make all colors in palette darker by specifying --dark-offset from 0-1:
hellwal -i [wallpaper] --light --dark-offset 0.5
  • same with --bright-offset:
hellwal -i [wallpaper] --bright-offset 0.5
  • invert colors --invert:
hellwal -i [wallpaper] --light --invert
  • specify gray scale, if you want monochromatic colors --gray-scale:
hellwal -i [wallpaper] --color --gray-scale 0.8

Scripts

With --script or -s you can run script(or any shell command) after hellwal. Note: it will only run if hellwal will not encounter any errors.

On a side note:

If you want your new terminals to open with previusly generated or specified color palette, add this templates to your ~/.config/hellwal/templates/ folder:

  • variables.sh
  • terminal.sh

then in .bash.rc add following lines:

source ~/.cache/hellwal/variables.sh
sh ~/.cache/hellwal/terminal.sh

Alternatively if you use fish add these to fish config:

source ~/.cache/hellwal/variablesfish.fish
fish ~/.cache/hellwal/terminal.sh

TODO

  • TODO: support for other OS's like Mac or Win

  • TODO: tweaking options for generated colors (func + dark-light mode
  • TODO: bright & dark offset value as cmd line argument
  • TODO: support for already built themes (like gruvbox etc.)
  • TODO: do more pleasant color schemes
  • TODO: better light theme
  • TODO: print proper program usage
  • TODO: -r for random
  • TODO: -s for scripts
  • TODO: gen. colors
  • TODO: templating
  • TODO: parsing

Showcase

showcase2

Special thanks: