Documentation
¶
Overview ¶
Package rainbow prints texts in beautiful rainbows in terminal. Usage is very simple:
import "github.com/arsham/rainbow/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.Int63n(256),
}
You can also use the Light as a Writer:
l := rainbow.Light{
Writer: os.Stdout, // to write to
Seed: rand.Int63n(256),
}
io.Copy(l, someReader)
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNilWriter is returned when Light.Writer is nil. ErrNilWriter = errors.New("nil writer") )
Functions ¶
func Display ¶
func Display(w io.Writer, opts *DisplayOpts)
Types ¶
type DisplayOpts ¶
Click to show internal directories.
Click to hide internal directories.