rainbow

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 1

README

rainbow

A fork of lolgopher which is based on lolcat.

Can colorize multiline-strings in rainbow-like colors, for the terminal.

  • Version: 1.0.1
  • License: Apache 2

Documentation

Index

Constants

View Source
const (
	DefaultSpread = 5.0
	DefaultFreq   = 0.1
)
View Source
const (
	ColorModeTrueColor = iota
	ColorMode256
	ColorMode0
)

Variables

This section is empty.

Functions

func New0Colorer

func New0Colorer() colorer

func New256Colorer

func New256Colorer() colorer

func NewTruecolorWriter

func NewTruecolorWriter(spread, freq float64, origin int) io.Writer

NewTruecolorWriter will return a new io.Writer with a default ColorMode of truecolor

func NewWriter

func NewWriter(spread, freq float64, origin int) io.Writer

NewWriter will return a new io.Writer with a default ColorMode of 256

func Printf

func Printf(format string, a ...any) (n int, err error)

func Println

func Println(a ...any) (n int, err error)

Types

type Writer

type Writer struct {
	Output    io.Writer
	ColorMode int

	Origin int
	Spread float64
	Freq   float64
	// contains filtered or unexported fields
}

Writer writes colorful output

func (*Writer) SetFreq

func (w *Writer) SetFreq(freq float64)

func (*Writer) SetOrigin

func (w *Writer) SetOrigin(origin int)

func (*Writer) SetSpread

func (w *Writer) SetSpread(spread float64)

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Write will write a byte slice to the Writer

Directories

Path Synopsis
cmd
banner command
hello command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL