Documentation ¶
Index ¶
- Constants
- Variables
- func BgColor256(s string, c byte) string
- func BgColorRGB(s string, r, g, b byte) string
- func BgRed(s string) string
- func Blue(s string) string
- func ByStyles(s string, styles ...Style) string
- func Color256(s string, c byte) string
- func ColorDepth() (int, error)
- func ColorRGB(s string, r, g, b byte) string
- func Custom(text string, begin, end any) string
- func Cyan(s string) string
- func EnableColor() bool
- func Gradient(text string, begin, end colorRGB) string
- func GradientMultiLine(text string, begin, end colorRGB) string
- func GradientMultiLineRandom(text string) string
- func GradientRandom(text string) string
- func Gray(s string) string
- func Green(s string) string
- func Magenta(s string) string
- func Move(n int, direction direction) string
- func NewColorRGB(r, g, b byte) colorRGB
- func Rainbow(text string) string
- func RainbowMultiLine(text string) string
- func Red(s string) string
- func SetPosition(x, y int) string
- func Yellow(s string) string
- type Style
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 BgColorRGB ¶ added in v1.5.11
func ColorDepth ¶ added in v1.5.11
func EnableColor ¶ added in v1.5.11
func EnableColor() bool
func GradientMultiLine ¶ added in v1.5.11
func GradientMultiLineRandom ¶ added in v1.5.11
func GradientRandom ¶ added in v1.5.11
func NewColorRGB ¶ added in v1.5.11
func NewColorRGB(r, g, b byte) colorRGB
func RainbowMultiLine ¶ added in v1.5.11
func SetPosition ¶ added in v1.0.6
Types ¶
Click to show internal directories.
Click to hide internal directories.