xcolor

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fail

func Fail(args ...string)

Fail 输出失败

func Info added in v0.0.5

func Info(args ...string)

Info 输出提示

func Success

func Success(args ...string)

Success 输出成功

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