~alva/zlolcat

update colorz
keep up with zig
update clap

clone

read-only
https://git.sr.ht/~alva/zlolcat
read/write
git@git.sr.ht:~alva/zlolcat

You can also use your local clone with git send-email.

#zlolcat 😸 builds.sr.ht status

it's a speedy and pretty little lolcat.

originally based on clolcat, now it has diverged in some ways:

  • multibyte characters and grapheme clusters are supported properly.
  • LCH colorspace is used for a more pleasant and accessible output.
  • parameters for luminance and chroma.
  • parameter for handling of ambiguous width characters.
  • yet over twice as fast in typical use, as measured by hyperfine on various inputs.

compared to other great implementations that support unicode properly, zlolcat is 400%-1200% faster in typical use, but slower on some edge-cases.

screenshot showing multibyte support and LCH colors

#building

install latest zig and do zig build install --prefix ~/.local -Doptimize=ReleaseFast.

#usage

install the program in your $PATH, and invoke zlolcat with something on stdin, or zlolcat file1 file2.

use zlolcat -h to see all the options. to randomise the rainbow phase, you can plug a random source in like zlolcat -s$RANDOM.

#acknowledgments

  • unicode support is thanks to ziglyph.
  • argument parsing is thanks to clap.