mirror of
https://gitlab.com/ashe.sterling/clrblk.git
synced 2026-07-08 23:17:14 +00:00
No description
- Rust 100%
| src | ||
| Cargo.toml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| rust-toolchain.toml | ||
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