xcolor

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const (
	F = "✘"
	S = "✔︎"
	I = "➤"
	L = "" /* 288-byte string literal not displayed */
)

...

Variables

This section is empty.

Functions

func Danger added in v0.0.8

func Danger(args ...interface{})

Danger ...

func Dangerf added in v0.0.8

func Dangerf(tpl string, args ...interface{})

Danger ...

func Info added in v0.0.5

func Info(args ...interface{})

Info ...

func Infof added in v0.0.8

func Infof(tpl string, args ...interface{})

Info ...

func Output added in v0.0.8

func Output(c Fg, texts ...interface{})

Output 处理提示前置

func Success

func Success(args ...interface{})

Success ...

func Successf added in v0.0.8

func Successf(tpl string, args ...interface{})

Success ...

func Warnning added in v0.0.8

func Warnning(args ...interface{})

Warnning ...

func Warnningf added in v0.0.8

func Warnningf(tpl string, args ...interface{})

Warnning ...

Types

type Bg

type Bg int

Bg 背景色枚举 (Basic 40, Hi-Intensity 100)

const (
	BgNone    Bg = iota + 99 // 默认背景
	BgBlack                  // 黑色背景
	BgRed                    // 红色背景
	BgGreen                  // 绿色背景
	BgYellow                 // 黄色背景
	BgBlue                   // 蓝色背景
	BgMagenta                // 洋红背景
	BgCyan                   // 青色背景
	BgWhite                  // 白色背景
)

背景色

func (Bg) String

func (t Bg) String() string

String 背景色描述

type Color

type Color interface {
	Fg(Fg) Color   // 设置前景色
	Bg(Bg) Color   // 设置背景色
	Sty(Sty) Color // 设置样式
	Text() string  // 返回渲染后文本
	Render()       // 输出渲染后文本
}

Color ...

func New

func New(texts ...string) Color

New ...

type Fg

type Fg int

Fg 前景色枚举 (Basic 30, Hi-Intensity 90)

const (
	FgNone    Fg = iota + 89 // 默认
	FgBlack                  // 黑色
	FgRed                    // 红色
	FgGreen                  // 绿色
	FgYellow                 // 黄色
	FgBlue                   // 蓝色
	FgMagenta                // 洋红
	FgCyan                   // 青色
	FgWhite                  // 白色
)

前景色

func (Fg) String

func (t Fg) String() string

String 前景色描述

type Sty

type Sty int

Sty 样式枚举

const (
	StyNone         Sty = iota // 默认
	StyBold                    // 加粗
	StyFaint                   // 弱化
	StyItalic                  // 斜体
	StyUnderline               // 下划
	StyBlinkSlow               // 慢闪
	StyBlinkRapid              // 快闪
	StyReverseVideo            // 反转
	StyConcealed               // 隐藏
	StyCrossedOut              // 中划
)

样式

func (Sty) String

func (t Sty) String() string

String 样式描述

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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