No description
Find a file
2026-06-14 20:06:07 -07:00
src Added hsv-based hex gradients, accessible with -m [mode] 2026-06-14 19:56:50 -07:00
Cargo.toml correct version string 2026-06-14 20:06:07 -07:00
CONTRIBUTING.md updated to md format 2025-04-15 17:17:00 +00:00
LICENSE Switch to GPL3 2026-06-14 20:03:21 -07:00
README.md Added hsv-based hex gradients, accessible with -m [mode] 2026-06-14 19:56:50 -07:00
rust-toolchain.toml Added rust-toolchain.toml to use rust-nightly 2026-05-30 22:57:36 -07:00

clrblk

clrblk is a command-line utility for printing color blocks in the terminal. It supports various color input formats, including ANSI codes, hexadecimal values, and named ANSI colors. Its only dependency is libc. Users can also specify a range of ANSI colors, a range for hexadecimal gradients, adjust block width, and enable inline range printing.

Features

  • Print color blocks using:
    • ANSI color codes
    • Hexadecimal colors
    • Hexadecimal gradients
    • Named ANSI colors
    • Ranges of ANSI colors
  • Customize block width
  • Inline range printing
  • ANSI color number labeling
  • ...And more!

Installation

AUR Installation

paru -S clrblk

or with yay (if you're not cool enough for paru):

yay -S clrblk

or if you're too cool for AUR helpers:

git clone https://aur.archlinux.org/clrblk.git
cd clrblk
makepkg -si

Manual Installation

I recommend building with level 3 optimizations and targeting your CPU if you plan to test SIMD using the --crazy function:

export RUSTFLAGS="-C opt-level=3 -C target-cpu=native"

Build it:

git clone https://gitlab.com/ashe.sterling/clrblk.git
cd clrblk
cargo build --release

then copy to somewhere in your $PATH

cp target/release/clrblk /path/to/path/in/$PATH

Usage

clrblk [OPTIONS] [color(1)] [color(2)]

Examples

Print a single ANSI color block

clrblk 34

Set block width

clrblk -w 10

Print an inline range of ANSI colors

clrblk -i 16 231

Print a hex color block

clrblk #ff5733

Print a named ANSI color block

clrblk bright_magenta

Print a range of ANSI colors

clrblk 16 231

Print a gradient of hex colors

clrblk f5a9b8 000000

Hex gradients can either use RGB or HSV, with RGB being the default.

clrblk f5a9b8 000000 -m hsv

Fit any output to terminal width (overrides -w width)

clrblk f5a9b8 000000 -f

Show a full screen of random color blocks that all fade to new random colors independently

This exists more as a technical demo for portable SIMD operations in Rust (still looks cool though)

clrblk --crazy