|
|
|
# colcat (lolcat)
|
|
|
|
|
|
|
|
Another lolcat clone, in 2020.
|
|
|
|
|
|
|
|
![image showing help text in rainbow colour](demo.png)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
- [busyloop/lolcat](https://github.com/busyloop/lolcat/) (Ruby) - the original
|
|
|
|
- [jaseg/lolcat](https://github.com/jaseg/lolcat) ( C )
|
|
|
|
- [tehmaze/lolcat](https://github.com/tehmaze/lolcat/) (Python)
|
|
|
|
- [gkbrk](https://gist.github.com/gkbrk/34ed7df44ba1400f31eb73a3f238faa7) (x64 Assembly)
|