color

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package color

@author: xwc1125

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Black

func Black(str string, modifier ...interface{}) string

Black 黑色

func Blue

func Blue(str string, modifier ...interface{}) string

Blue 蓝色

func Brown

func Brown(str string, modifier ...interface{}) string

Brown 棕色

func ColorRender

func ColorRender(str string, foregroundColor ForegroundColor, backgroundColor BackgroundColor, extraArgs ...ShowType) string

ColorRender color颜色处理 str 文本 foregroundColor 前景色 backgroundColor 背景色 extraArgs 扩展的显示方式

func Cyan

func Cyan(str string, modifier ...interface{}) string

Cyan 青色/蓝绿色

func DarkGray

func DarkGray(str string, modifier ...interface{}) string

DarkGray 深灰色

func Green

func Green(str string, modifier ...interface{}) string

Green 绿色字体,modifier里,第一个控制闪烁,第二个控制下划线

func LightBlue

func LightBlue(str string, modifier ...interface{}) string

LightBlue 淡蓝

func LightCyan

func LightCyan(str string, modifier ...interface{}) string

LightCyan 淡青色

func LightGray

func LightGray(str string, modifier ...interface{}) string

LightGray 浅灰色

func LightGreen

func LightGreen(str string, modifier ...interface{}) string

LightGreen 淡绿

func LightPurple

func LightPurple(str string, modifier ...interface{}) string

LightPurple 淡紫色

func LightRed

func LightRed(str string, modifier ...interface{}) string

LightRed 淡红色

func Purple

func Purple(str string, modifier ...interface{}) string

Purple 紫色

func Red

func Red(str string, modifier ...interface{}) string

Red 红字体

func White

func White(str string, modifier ...interface{}) string

White 白色

func Yellow

func Yellow(str string, modifier ...interface{}) string

Yellow 黄色字体

Types

type BackgroundColor

type BackgroundColor int
const (
	BackgroundColor_Transparent BackgroundColor = iota + 39 // 39
	BackgroundColor_Black                                   // 40
	BackgroundColor_Red                                     // 41
	BackgroundColor_Green                                   // 42
	BackgroundColor_Yellow                                  // 43
	BackgroundColor_Blue                                    // 44
	BackgroundColor_Fuchsia                                 // 45
	BackgroundColor_Cyan                                    // 46
	BackgroundColor_White                                   // 47
)

type ForegroundColor

type ForegroundColor int
const (
	ForegroundColor_Black  ForegroundColor = iota + 30 // 30
	ForegroundColor_Red                                // 31
	ForegroundColor_Green                              // 32
	ForegroundColor_Yellow                             // 33
	ForegroundColor_Blue                               // 34
	ForegroundColor_Purple                             // 35
	ForegroundColor_Cyan                               // 36
	ForegroundColor_White                              // 37
)

type ShowType

type ShowType int

ShowType 显示方式

const (
	ShowType_Terminal  ShowType = 0 // 终端默认设置
	ShowType_Highlight ShowType = 1 // 高亮显示
	ShowType_Underline ShowType = 4 // 使用下划线
	ShowType_Blink     ShowType = 5 // 闪烁
	ShowType_Reverse   ShowType = 7 // 反白显示
	ShowType_Invisible ShowType = 8 // 不可见
)

Jump to

Keyboard shortcuts

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