colorize

package module
v0.0.0-...-499a534 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 4 Imported by: 0

README

colorize

Simple library for applying color to terminal output colorized output

Use

colorizer := colorize.New(colornames.Firebrick, colornames.Mediumaquamarine)
colorizer.Println("I've got a firebrick foreground and medium aquamarine background!")

colorized output

You can get back a color formatted string or byte slice directly as well. A couple of the major print methods are supported, but open to suggestions about additional functionality.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Colorizer

type Colorizer struct {
	// contains filtered or unexported fields
}

func New

func New(foregroundColor, backgroundColor color.Color) *Colorizer

func (*Colorizer) Bytes

func (c *Colorizer) Bytes(input []byte) []byte

func (*Colorizer) Print

func (c *Colorizer) Print(input interface{})

func (*Colorizer) Printf

func (c *Colorizer) Printf(format string, args ...interface{})

func (*Colorizer) Println

func (c *Colorizer) Println(input interface{})

func (*Colorizer) Sprintf

func (c *Colorizer) Sprintf(format string, args ...interface{}) string

func (*Colorizer) UpdateBackground

func (c *Colorizer) UpdateBackground(backgroundColor color.Color)

func (*Colorizer) UpdateForeground

func (c *Colorizer) UpdateForeground(foregroundColor color.Color)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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