A command line tool for playing with color gradients

Overview

gradient

Build Status

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

gradient can be installed with cargo.

cargo install gradient

Usage

gradient [OPTIONS]

Options:

  • -W, --width : Gradient display width (default: terminal width)
  • -H, --height : Gradient display height (default: 2)
  • -b, --background : Background color (default: checkerboard)
  • -s, --sample ... : Get color(s) at specific position
  • -t, --take : Get N colors evenly spaced across gradient
  • -o, --format : Output color format (default: hex) [hex, rgb, rgb255, hsl, hsv, hwb]

Preset gradient

  • -p, --preset : Using the preset gradient
  • -l, --list-presets : Lists all available preset gradients

Custom gradient

  • -c, --custom ... : Create custom gradient
  • -m, --blend-mode : Custom gradient blending mode (default: oklab) [rgb, linear-rgb, hsv, oklab]
  • -i, --interpolation : Custom gradient interpolation mode (default: catmull-rom) [linear, basis, catmull-rom]
  • -P, --position ... : Custom gradient color position

Gradient file

  • -f, --file ... : Read gradient from SVG or GIMP gradient (ggr) file(s)
  • --ggr-fg : GGR foreground color (default: black)
  • --ggr-bg : GGR background color (default: white)
  • --svg-id : Pick 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

You might also like...
Detects whether a terminal supports color, and gives details about that support

Detects whether a terminal supports color, and gives details about that support. It takes into account the NO_COLOR environment variable. This crate i

Parse hex colors to tui::style::Color

Color - Tui Parse hex colors to tui rgb colors #c3f111 - Color::Rgb(195,241,17) Note that the indexed colors are NOT HEX #142 - Color::Indexed(142)

Tiny color conversion library for TUI application builders
Tiny color conversion library for TUI application builders

Definition of ANSI, RGB and HSL color types and all the conversions between them. There are many other color conversion crates. This one may be useful

Sanctity is an acronym for rust ansi16 color test utility
Sanctity is an acronym for rust ansi16 color test utility

sanctity 🌈 sanctity is an acronym for rust ansi16 color test utility. It prints your own text or the default text in all of the 16 terminal colors.

An abstract, safe, and concise color conversion library for rust nightly This requires the feature adt_const_params

colortypes A type safe color conversion library This crate provides many methods for converting between color types. Everything is implemented abstrac

Adapt the screen's color spectrum according to the hour of the day in order to improve your sleep

circadianlight What It Is Circadian Light is a program, currently only working on Linux with X, that controls the color spectrum of your screen accord

A rust crate for working with colors and color spaces.
A rust crate for working with colors and color spaces.

Color Art A rust crate for working with colors and color spaces. Documentation See Color Art. Usage Add Dependency [dependencies] color-art = "0.2" Co

🎨✨ Show off your soothing color palette
🎨✨ Show off your soothing color palette

🎨 Show off your soothing color palette ✨ Palettes · install · contribute · Gratitute 🎨 Palettes Rust C Lua Ruby Go sh js 🚀 install Installing this

Convert your favorite images and wallpapers with your favorite color palettes/themes
Convert your favorite images and wallpapers with your favorite color palettes/themes

dipc doprz' image palette converter Convert your favorite images and wallpapers with your favorite color palettes/themes Color Palettes/Themes catppuc

Comments
  • Add NetBSD install instructions

    Add NetBSD install instructions

    I've packaged gradiente for NetBSD and merged the package today into our main branch. FYI, http://mail-index.netbsd.org/pkgsrc-changes/2022/10/15/msg262055.html

    opened by 0323pin 1
  • Fixes a compilation error during installation

    Fixes a compilation error during installation

    When using cargo install gradient (or cargo install --path . using a local repo) the compilation failed because clap could not find the method multiple in Arg<'_>.

    This error occured because cargo install used claps beta version 4 instead of 2. The argument modifier multiple has been removed in the newer version.

    This PR fixes this issue by substituting multiple = true for multiple_values = true, multiple_occurrences = true (which does the same as the old multiple) and setting as well as fixing claps version to 3.0.0-beta.4.

    opened by jo-goro 1
Owner
Nor Khasyatillah
Nor Khasyatillah
A Rust port of the command line program playing with the cutscenes files (USM) from Genshin Impact.

GI-cutscenes : Rust Remix A command line program playing with the cutscene files (USM) from Genshin Impact, reimplemented in Rust. Much like its origi

Lymkwi 5 Nov 6, 2022
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
A cli utility for playing music mixes for programming & focus from musicforprogramming.net

mfp: music for programming A command-line utility for playing music mixes for programming & focus (from musicforprogramming.net), unlocking the flow s

Rohit Gupta 10 Jul 12, 2023
Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

null 3 Nov 2, 2023
dye is a tool to easily color text in shell.

Dye dye is a tool to easily color text in shell. Usage See the gif below to see these commands in action. echo $(dye --red WARN) This tool will knock

Kurt Wolf 15 Nov 1, 2022
A command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects.

CCake CCake is a command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects. Goals To be easily und

Boston Vanseghi 4 Oct 24, 2022
Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

Vitaly Shukela 3 Jan 3, 2023
A dead simple ANSI terminal color painting library for Rust.

yansi A dead simple ANSI terminal color painting library for Rust. use yansi::Paint; print!("{} light, {} light!", Paint::green("Green"), Paint::red(

Sergio Benitez 169 Dec 25, 2022
`ls` alternative with useful info and a splash of color 🎨

?? Natls ?? Why Natls? Showing file permissions Showing file size Showing the date that the file was modified last Showing the user that the file belo

Will 1.2k Dec 19, 2022
Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and at compile-time.

rgb2ansi256 rgb2ansi256 is a small Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and const fn. Th

Linda_pp 7 Nov 17, 2022