Skip to content

mazznoer/gradient-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gradient

Build Status crates.io

A command-line tool for playing with color gradients.

gradient-cli-tool

Features

  • Lots of preset gradients.
  • Custom gradient.
  • Read gradients from SVG & GIMP gradient (ggr) file.
  • Display gradient in the terminal.
  • Get colors from gradient.

Installation

Pre-compiled binaries for Linux, macOS and Windows is avaliable on release page.

Cargo

gradient can be installed using cargo.

cargo install gradient

NetBSD

On NetBSD, a pre-compiled binary is available from the official repositories. To install it, simply run:

pkgin install gradient

Usage

gradient [OPTIONS]

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

Preset gradient

  • -p, --preset <NAME> : Using the preset gradient
  • -l, --list-presets : Lists all available preset gradient names

Custom gradient

  • -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

Gradient file

  • -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 ID

COLOR can be specified using CSS color format.

Usage Examples

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

About

A command line tool for playing with color gradients

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy