RAINBOW(1)

NAME

rainbowTasty rainbows for your terminal! (lolcat clone)

SYNOPSIS

$go install github.com/arsham/rainbow/v2@latest

INFO

80 stars
5 forks
0 views

DESCRIPTION

Tasty rainbows for your terminal! (lolcat clone)

README

Rainbow

PkgGoDev GitHub go.mod Go version Build Status Coverage Status Codacy Badge Go Report Card License

Tasty rainbows for your terminal like these:

Screenshot

This app was inspired by lolcats, but written in Go.

Table of Contents

  1. Installation
  2. Usage
  3. As library
  4. See Also
  5. License

Installation

You can download the latest binary from here, or you can compile from source:

go install github.com/arsham/rainbow/v2@latest

If you need support for Go versions before Go 1.26, use the v1 module instead.

Usage

You can pipe the text into the app in many ways. Choose one that is suitable for you:

# File contents:
rainbow < filename.txt

Echo a string:

echo "Any quotes" | rainbow

Here string:

rainbow <<END Consectetur aliqua do quis sed proident enim fugiat occaecat nisi in deserunt culpa aliquip do excepteur. END

Output of a program:

ls -l | rainbow

As library

Light struct implements io.Reader and io.Writer:

import "github.com/arsham/rainbow/v2/rainbow"
// ...
l := rainbow.Light{
    Reader: someReader, // to read from
    Writer: os.Stdout, // to write to
}
l.Paint() // will rainbow everything it reads from reader to writer.

If you want the rainbow to be random, you can seed it this way:

l := rainbow.Light{
    Reader: buf,
    Writer: os.Stdout,
    Seed:   rand.Int64N(256),
}

Or if you prefer io.Copy:

l := rainbow.Light{
    Writer: os.Stdout,
    Seed:   rand.Int64N(256),
}
io.Copy(l, someReader)

See Also

See also Figurine. It prints beautiful ASCII arts in FIGlet.

License

Use of this source code is governed by the Apache 2.0 license. License that can be found in the LICENSE file.

Please note that this was initially forked from glolcat, but I decided to rewrite it as the library is not maintained anymore.

SEE ALSO

clihub5/7/2026RAINBOW(1)