color

package
v1.0.1006 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NoColor defines if the output is colorized or not.
	NoColor = color.NoColor

	// Output defines the standard output of the print functions. By default
	// os.Stdout is used.
	Output = color.Output

	// Error defines a color supporting writer for os.Stderr.
	Error = color.Error
)

Functions

func BackgroundHiOption

func BackgroundHiOption(name string) color.Attribute

背景高亮色,可用颜色 black | red | green | yellow | blue | magenta | cyan | white

func BackgroundOption

func BackgroundOption(name string) color.Attribute

背景色,可用颜色 black | red | green | yellow | blue | magenta | cyan | white

func BaseOption

func BaseOption(name string) color.Attribute

基础设置,可用参数 reset | bold | faint | italic | underline blinkSlow | blinkRapid | reverseVideo | concealed | crossedOut

func Black

func Black(msg string, arg ...any)

func BlackPrint

func BlackPrint(msg string, arg ...any)

func BlackString

func BlackString(msg string, arg ...any) string

func Blackln

func Blackln(msg string, arg ...any)

func Blue

func Blue(msg string, arg ...any)

func BluePrint

func BluePrint(msg string, arg ...any)

func BlueString

func BlueString(msg string, arg ...any) string

func Blueln

func Blueln(msg string, arg ...any)

func Cyan

func Cyan(msg string, arg ...any)

func CyanPrint

func CyanPrint(msg string, arg ...any)

func CyanString

func CyanString(msg string, arg ...any) string

func Cyanln

func Cyanln(msg string, arg ...any)

func ForegroundHiOption

func ForegroundHiOption(name string) color.Attribute

前景高亮色,可用颜色 black | red | green | yellow | blue | magenta | cyan | white

func ForegroundOption

func ForegroundOption(name string) color.Attribute

前景色,可用颜色 black | red | green | yellow | blue | magenta | cyan | white

func FormatTrim

func FormatTrim(msg string) string

清除多余字符

func Green

func Green(msg string, arg ...any)

func GreenPrint

func GreenPrint(msg string, arg ...any)

func GreenString

func GreenString(msg string, arg ...any) string

func Greenln

func Greenln(msg string, arg ...any)

func HiBlack

func HiBlack(format string, arg ...any)

func HiBlackString

func HiBlackString(format string, arg ...any) string

func HiBlue

func HiBlue(format string, arg ...any)

func HiBlueString

func HiBlueString(format string, arg ...any) string

func HiCyan

func HiCyan(format string, arg ...any)

func HiCyanString

func HiCyanString(format string, arg ...any) string

func HiGreen

func HiGreen(format string, arg ...any)

func HiGreenString

func HiGreenString(format string, arg ...any) string

func HiMagenta

func HiMagenta(format string, arg ...any)

func HiMagentaString

func HiMagentaString(format string, arg ...any) string

func HiRed

func HiRed(format string, arg ...any)

func HiRedString

func HiRedString(format string, arg ...any) string

func HiWhite

func HiWhite(format string, arg ...any)

func HiWhiteString

func HiWhiteString(format string, arg ...any) string

func HiYellow

func HiYellow(format string, arg ...any)

func HiYellowString

func HiYellowString(format string, arg ...any) string

func Magenta

func Magenta(msg string, arg ...any)

func MagentaPrint

func MagentaPrint(msg string, arg ...any)

func MagentaString

func MagentaString(msg string, arg ...any) string

func Magentaln

func Magentaln(msg string, arg ...any)

func New

func New(value ...color.Attribute) *color.Color

根据选项显示颜色

func NewWithOption

func NewWithOption(value ...color.Attribute) *color.Color

根据选项显示颜色

func Raw

func Raw(msg string, arg ...any)

func Rawln

func Rawln(msg string, arg ...any)

func Red

func Red(msg string, arg ...any)

func RedPrint

func RedPrint(msg string, arg ...any)

func RedString

func RedString(msg string, arg ...any) string

func Redln

func Redln(msg string, arg ...any)

func ShowMessage

func ShowMessage(colorname string, msg string, arg ...any)

func ShowMessageln

func ShowMessageln(colorname string, msg string, arg ...any)

func White

func White(msg string, arg ...any)

func WhitePrint

func WhitePrint(msg string, arg ...any)

func WhiteString

func WhiteString(msg string, arg ...any) string

func Whiteln

func Whiteln(msg string, arg ...any)

func Yellow

func Yellow(msg string, arg ...any)

func YellowPrint

func YellowPrint(msg string, arg ...any)

func YellowString

func YellowString(msg string, arg ...any) string

func Yellowln

func Yellowln(msg string, arg ...any)

Types

type ColorFunc

type ColorFunc = func(string, ...any)

func NewColorFunc

func NewColorFunc(colorname string) ColorFunc

实例化一个方法

Jump to

Keyboard shortcuts

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