A colorscheme generator
Go to file
Agatha Lovelace 93a44c16c1
Add support for an Oklab backend; Improve contrast
2023-10-03 19:35:23 +02:00
.github/workflows Better CI 2023-09-10 18:47:57 +02:00
src Add support for an Oklab backend; Improve contrast 2023-10-03 19:35:23 +02:00
.envrc Initial commit 2023-04-09 17:24:03 +02:00
.gitignore Replace atty with is_terminal() 2023-09-10 19:36:36 +02:00
Cargo.lock Add support for an Oklab backend; Improve contrast 2023-10-03 19:35:23 +02:00
Cargo.toml Add support for an Oklab backend; Improve contrast 2023-10-03 19:35:23 +02:00
LICENSE.md Initial commit 2023-04-09 17:24:03 +02:00
README.md Add light theme support 2023-06-08 12:46:53 +02:00
default.nix Initial commit 2023-04-09 17:24:03 +02:00
flake.lock Add support for an Oklab backend; Improve contrast 2023-10-03 19:35:23 +02:00
flake.nix Add light theme support 2023-06-08 12:46:53 +02:00
shell.nix Initial commit 2023-04-09 17:24:03 +02:00

README.md

Colorpickle

Screenshot of a colorscheme output in a terminal

A colorscheme generator.

Building

Clone this repository, then run:

cargo build --release

The output binary will be in target/release/colorpickle

Alternatively,

nix build github:AgathaSorceress/colorpickle

A binary for linux-x86_64 is built on each commit and uploaded to Artifacts.

Usage

Usage: colorpickle [OPTIONS] <IMAGE>

Arguments:
  <IMAGE>  Path to image to pick colors from

Options:
  -c, --colors <COLORS>          Number of colors to generate (excluding bold colors) [default: 8]
  -b, --no-bold                  Skip generating bold color variants
      --bold-delta <BOLD_DELTA>  How much lightness should be added to bold colors [default: 0.2]
      --rotate-hue <ROTATE_HUE>  Rotate colors along the hue axis [default: 0]
      --lighten <LIGHTEN>        Lighten/darken colors [default: 0]
      --saturate <SATURATE>      Saturate/desaturate colors [default: 0]
  -l, --light                    Generate a light colorscheme
  -h, --help                     Print help
  -V, --version                  Print version

Using the NixOS module

After importing the NixOS module exposed by this flake, a colorscheme can be defined like this:

environment.graphical.colorschemes.purple = {
  image = ../../../external/6.png;
  params = [ "--lighten" "0.05" "--bold-delta" "0.1" ];
};

The generated colors will be accessible from environment.graphical.colors.purple as an attribute set of hex color strings:

nix-repl> nodes.ritual.config.environment.graphical.colors.purple
{ "0" = "#19172b"; "1" = "#453354"; "10" = "#90629a"; "11" = "#7a6d98"; "12" = "#9a79ab"; "13" = "#a6a1bc"; "14" = "#b69dba"; "15" = "#d0c5dc"; "16" = ""; "2" = "#734e7b"; "3" = "#62577b"; "4" = "#825d94"; "5" = "#8a83a7"; "6" = "#a07fa5"; "7" = "#b7a5c9"; "8" = "#2c294c"; "9" = "#5f4674"; }