lolcat in c
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
alistair 5c53afc4d4 fix utf8 support 3 years ago
c-colours@fbf7c25226 cosmopolitan support 3 years ago
Makefile cosmopolitan support 3 years ago
colcat.c fix utf8 support 3 years ago
demo.png help text, args, and custom gradient 4 years ago
readme.md cosmopolitan support 3 years ago

readme.md

colcat (lolcat)

Another lolcat clone, in 2020.

image showing help text in rainbow colour

This is probably the least feature-complete version of lolcat, (the cat clone that makes the output rainbow), but I wrote it anyway and probably won't do any more work on it. I wrote this to test my colours library that I'm writing for a simple flat-shaded 2D game I've been working on for a while in bits and pieces.

It seems to mostly be compatible with other ANSI codes now.

Options:

Usage: colcat [args] [--] [FILES]

Concatenate files (or standard input) and print on the standard
output, with a rainbow colour. The colour range and repeat
distance can be specified.

Args:

      -h           Print help text and exit
      -w <int>     Width, in chars, of the rainbow sequence
      -r <int>     The amount the hue is rotated on new lines
      -s <int>     The hue to start the rainbow at
      -e <int>     The hue to end the rainbow at

It is the norm for these programs to fuzz the rainbow a bit, and provide more options for the frequency and animation options. Mine doesn't have animation, and it is deterministic.

Compared to other versions this one is slightly more vibrant and uses truecolour. This means the rainbow is slightly more accurate, but if your terminal doesn't support truecolour then it will output garbage (I don't check any terminfo stuff, or check that the output is a tty).

It is also about 9K larger than jaseg's version, of course it is still more performant than the ruby/node/python versions, it just might have bugs. :)

Installation

1: Use The prebuilt Cosmopolitan binary

Available on the releases tab.

2: Build using cosmopolitan

git clone https://git.topost.net/alistair/colcat.git
cd colcat
curl https://storage.googleapis.com/justine/cosmopolitan/cosmopolitan.zip --output cosmopolitan.zip
unzip cosmopolitan.zip
make cosmo
make installcosmo

3: Built for local platform

git clone https://git.topost.net/alistair/colcat.git
cd colcat
make
make install

Installs colcat to /usr/local/bin/

Similar Programs