color

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: MIT Imports: 4 Imported by: 1

README

color

Terminal output with ANSI colors in Go.

go get github.com/mengdu/color
func main() {
  fmt.Println(color.Std.Red().String("Hello, world!"))
  fmt.Println(color.Std.Bolb().Italic().Underline().Red().String("Hello, world!"))

  c := color.New(color.EnableColor(true)) // new instance
  fmt.Println(color.Red().String("Red"))
}

Examples

Documentation

Index

Constants

This section is empty.

Variables

Functions

func EnableColor

func EnableColor(cache bool) (result bool)

Types

type ColorFn

type ColorFn func(s string) (open []string, clase []string, out string, enableColor bool)

func New

func New(enable bool) ColorFn

func (ColorFn) BgBlack

func (c ColorFn) BgBlack() ColorFn

func (ColorFn) BgBlue

func (c ColorFn) BgBlue() ColorFn

func (ColorFn) BgBlueBright

func (c ColorFn) BgBlueBright() ColorFn

func (ColorFn) BgCyan

func (c ColorFn) BgCyan() ColorFn

func (ColorFn) BgCyanBright

func (c ColorFn) BgCyanBright() ColorFn

func (ColorFn) BgGray

func (c ColorFn) BgGray() ColorFn

func (ColorFn) BgGreen

func (c ColorFn) BgGreen() ColorFn

func (ColorFn) BgGreenBright

func (c ColorFn) BgGreenBright() ColorFn

func (ColorFn) BgMagenta

func (c ColorFn) BgMagenta() ColorFn

func (ColorFn) BgMagentaBright

func (c ColorFn) BgMagentaBright() ColorFn

func (ColorFn) BgRed

func (c ColorFn) BgRed() ColorFn

func (ColorFn) BgRedBright

func (c ColorFn) BgRedBright() ColorFn

func (ColorFn) BgWhite

func (c ColorFn) BgWhite() ColorFn

func (ColorFn) BgWhiteBright

func (c ColorFn) BgWhiteBright() ColorFn

func (ColorFn) BgYellow

func (c ColorFn) BgYellow() ColorFn

func (ColorFn) BgYellowBright

func (c ColorFn) BgYellowBright() ColorFn

func (ColorFn) Black

func (c ColorFn) Black() ColorFn

func (ColorFn) Blue

func (c ColorFn) Blue() ColorFn

func (ColorFn) BlueBright

func (c ColorFn) BlueBright() ColorFn

func (ColorFn) Bold

func (c ColorFn) Bold() ColorFn

func (ColorFn) Cyan

func (c ColorFn) Cyan() ColorFn

func (ColorFn) CyanBright

func (c ColorFn) CyanBright() ColorFn

func (ColorFn) Dim

func (c ColorFn) Dim() ColorFn

func (ColorFn) Gray

func (c ColorFn) Gray() ColorFn

func (ColorFn) Green

func (c ColorFn) Green() ColorFn

func (ColorFn) GreenBright

func (c ColorFn) GreenBright() ColorFn

func (ColorFn) Invisible

func (c ColorFn) Invisible() ColorFn

func (ColorFn) Italic

func (c ColorFn) Italic() ColorFn

func (ColorFn) Magenta

func (c ColorFn) Magenta() ColorFn

func (ColorFn) MagentaBright

func (c ColorFn) MagentaBright() ColorFn

func (ColorFn) Red

func (c ColorFn) Red() ColorFn

func (ColorFn) RedBright

func (c ColorFn) RedBright() ColorFn

func (ColorFn) Reverse

func (c ColorFn) Reverse() ColorFn

func (ColorFn) StrikeThrough

func (c ColorFn) StrikeThrough() ColorFn

func (ColorFn) String

func (f ColorFn) String(s string) string

func (ColorFn) Underline

func (c ColorFn) Underline() ColorFn

func (ColorFn) White

func (c ColorFn) White() ColorFn

func (ColorFn) WhiteBright

func (c ColorFn) WhiteBright() ColorFn

func (ColorFn) Yellow

func (c ColorFn) Yellow() ColorFn

func (ColorFn) YellowBright

func (c ColorFn) YellowBright() ColorFn

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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