| Crates.io | gradient |
| lib.rs | gradient |
| version | 0.4.1 |
| created_at | 2021-06-01 17:02:23.550825+00 |
| updated_at | 2025-05-08 07:59:46.98155+00 |
| description | A command line tool for playing with color gradients |
| homepage | |
| repository | https://github.com/mazznoer/gradient-rs |
| max_upload_size | |
| id | 404815 |
| size | 77,862 |
gradientA command-line tool for playing with color gradients.

Pre-compiled binaries for Linux, macOS and Windows is avaliable on release page.
gradient can be installed using cargo.
cargo install gradient
On NetBSD, a pre-compiled binary is available from the official repositories. To install it, simply run:
pkgin install gradient
gradient [OPTIONS]
-W, --width <NUM> : Gradient display width (default: terminal width)-H, --height <NUM> : Gradient display height (default: 2)-b, --background <COLOR> : Background color (default: checkerboard)--cb-color <COLOR> <COLOR> : Checkerboard color-s, --sample <FLOAT>... : Get color(s) at specific position-t, --take <NUM> : Get N colors evenly spaced across gradient-o, --format <FORMAT> : Output color format (default: hex) [hex, rgb, rgb255, hsl, hsv, hwb]-a, --array : Print colors as array-p, --preset <NAME> : Using the preset gradient-l, --list-presets : Lists all available preset gradient names-c, --custom <COLOR>... : Create custom gradient-m, --blend-mode <MODE> : Custom gradient blending mode (default: oklab) [rgb, linear-rgb, hsv, oklab]-i, --interpolation <MODE> : Custom gradient interpolation mode (default: catmull-rom) [linear, basis, catmull-rom]-P, --position <FLOAT>... : Custom gradient color position-f, --file <FILE>... : Read gradient from SVG or GIMP gradient (ggr) file(s)--ggr-fg <COLOR> : GGR foreground color (default: black)--ggr-bg <COLOR> : GGR background color (default: white)--svg-id <ID> : Pick one SVG gradient by IDCOLOR can be specified using CSS color format.
Get 100 colors (evenly spaced accross gradient domain) from rainbow preset gradient.
gradient -p rainbow -t 100
Display all gradients from svg file.
gradient -f file.svg
Create custom gradient.
gradient -c gold ff4700 'rgb(90,230,170)' 'hsl(340,50%,50%)' 'hsv(270,60%,70%)' 'hwb(230,50%,0%)'
TODO add more examples