style

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectionUp    direction = "A"
	DirectionDown  direction = "B"
	DirectionRight direction = "C"
	DirectionLeft  direction = "D"
)
View Source
const (
	OperationSave          operation = "s"
	OperationRestore       operation = "u"
	OperationClear         operation = "2J"
	OperationClearLineTail operation = "K"
	OperationHide          operation = "?25l"
	OperationDisplay       operation = "?25h"
)
View Source
const (
	DecorationResetBold = 22 + iota

	DecorationResetUnderline
	DecorationResetFlashing

	DecorationResetReverse
)

Variables

View Source
var (
	RainbowRGB       = [...]colorRGB{RainbowRedRGB, RainbowOrangeRGB, RainbowYellowRGB, RainbowGreenRGB, RainbowCyanRGB, RainbowBlueRGB, RainbowPurpleRGB}
	RainbowRedRGB    = NewColorRGB(255, 0, 0)
	RainbowOrangeRGB = NewColorRGB(255, 165, 0)
	RainbowYellowRGB = NewColorRGB(255, 255, 0)
	RainbowGreenRGB  = NewColorRGB(0, 255, 0)
	RainbowCyanRGB   = NewColorRGB(0, 255, 255)
	RainbowBlueRGB   = NewColorRGB(0, 0, 255)
	RainbowPurpleRGB = NewColorRGB(128, 0, 128)
)

Functions

func BgColor256 added in v1.5.11

func BgColor256(s string, c byte) string

func BgColorRGB added in v1.5.11

func BgColorRGB(s string, r, g, b byte) string

func BgRed added in v1.5.11

func BgRed(s string) string

func Blue

func Blue(s string) string

func ByStyles added in v1.5.11

func ByStyles(s string, styles ...Style) string

func Color256 added in v1.5.11

func Color256(s string, c byte) string

func ColorDepth added in v1.5.11

func ColorDepth() (int, error)

func ColorRGB added in v1.5.11

func ColorRGB(s string, r, g, b byte) string

func Custom added in v1.5.11

func Custom(text string, begin, end any) string

func Cyan added in v1.5.11

func Cyan(s string) string

func EnableColor added in v1.5.11

func EnableColor() bool

func Gradient added in v1.5.11

func Gradient(text string, begin, end colorRGB) string

func GradientMultiLine added in v1.5.11

func GradientMultiLine(text string, begin, end colorRGB) string

func GradientMultiLineRandom added in v1.5.11

func GradientMultiLineRandom(text string) string

func GradientRandom added in v1.5.11

func GradientRandom(text string) string

func Gray

func Gray(s string) string

func Green

func Green(s string) string

func Magenta added in v1.5.11

func Magenta(s string) string

func Move added in v1.0.6

func Move(n int, direction direction) string

func NewColorRGB added in v1.5.11

func NewColorRGB(r, g, b byte) colorRGB

func Rainbow added in v1.5.11

func Rainbow(text string) string

func RainbowMultiLine added in v1.5.11

func RainbowMultiLine(text string) string

func Red

func Red(s string) string

func SetPosition added in v1.0.6

func SetPosition(x, y int) string

func Yellow

func Yellow(s string) string

Types

type Style

type Style int
const (
	DecorationNormal Style = iota
	DecorationBold

	DecorationItalic
	DecorationUnderline
	DecorationFlashing

	DecorationReverse
)
const (
	ColorBlack Style = 30 + iota
	ColorRed
	ColorGreen
	ColorYellow
	ColorBlue
	ColorMagenta
	ColorCyan
	ColorGray
)
const (
	HighLightColorBlack Style = 90 + iota
	HighLightColorRed
	HighLightColorGreen
	HighLightColorYellow
	HighLightColorBlue
	HighLightColorMagenta
	HighLightColorCyan
	HighLightColorGray
)
const (
	BackGroundBlack Style = 40 + iota
	BackgroundRed
	BackgroundGreen
	BackgroundYellow
	BackgroundBlue
	BackgroundMagenta
	BackgroundCyan
	BackgroundGray
)
const (
	HighLightBackGroundBlack Style = 100 + iota
	HighLightBackGroundRed
	HighLightBackGroundGreen
	HighLightBackGroundYellow
	HighLightBackGroundBlue
	HighLightBackGroundMagenta
	HighLightBackGroundCyan
	HighLightBackGroundGray
)

func (Style) String added in v1.0.6

func (d Style) String() string

Jump to

Keyboard shortcuts

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