style

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT, Apache-2.0 Imports: 10 Imported by: 1

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 (
	DcResetBold = 22 + iota
	DcResetItalic
	DcResetUnderline
	DcResetFlashing

	DcResetReverse
	DcResetConcealed
	DcResetCrossedOut
)

Variables

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

Functions

func BgColor256

func BgColor256(s string, c byte) string

func BgRGB

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

func BgRed

func BgRed(s string) string

func Blue

func Blue(s string) string

func Color256

func Color256(s string, c byte) string

func ColorDepth

func ColorDepth() (int, error)

func Custom

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

func Cyan

func Cyan(s string) string

func EnableColor

func EnableColor() bool

func Gradient

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

func GradientMultiLine

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

func GradientMultiLineRandom

func GradientMultiLineRandom(text string) string

func GradientRandom

func GradientRandom(text string) string

func Gray

func Gray(s string) string

func Green

func Green(s string) string

func Magenta

func Magenta(s string) string

func Move

func Move(n int, direction direction) string

func NewRGBColor

func NewRGBColor(r, g, b byte) colorRGB

func RGB

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

func Rainbow

func Rainbow(text string) string

func RainbowMultiLine

func RainbowMultiLine(text string) string

func Red

func Red(s string) string

func SetPosition

func SetPosition(x, y int) string

func Styles

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

func Yellow

func Yellow(s string) string

Types

type Style

type Style int
const (
	DcReset Style = iota
	DcBold
	DcFaint
	DcItalic
	DcUnderline
	DcFlashSlow
	DcFlashRapid
	DcReverse
	DcConcealed
	DcCrossedOut
)

Decoration

const (
	ColorBlack Style = 30 + iota
	ColorRed
	ColorGreen
	ColorYellow
	ColorBlue
	ColorMagenta
	ColorCyan
	ColorGray
)

Color

const (
	HLColorBlack Style = 90 + iota
	HLColorRed
	HLColorGreen
	HLColorYellow
	HLColorBlue
	HLColorMagenta
	HLColorCyan
	HLColorGray
)

HighLightColor

const (
	BgColorBlack Style = 40 + iota
	BgColorRed
	BgColorGreen
	BgColorYellow
	BgColorBlue
	BgColorMagenta
	BgColorCyan
	BgColorGray
)

BackGround

const (
	HLBgColorBlack Style = 100 + iota
	HLBgColorRed
	HLBgColorGreen
	HLBgColorYellow
	HLBgColorBlue
	HLBgColorMagenta
	HLBgColorCyan
	HLBgColorGray
)

HighLightBackGround

func (Style) String

func (d Style) String() string

Jump to

Keyboard shortcuts

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