Documentation ¶
Index ¶
- Constants
- Variables
- func BgColor256(s string, c byte) string
- func BgRGB(s string, r, g, b byte) string
- func BgRed(s string) string
- func Blue(s string) string
- func Color256(s string, c byte) string
- func ColorDepth() (int, error)
- func Custom(s 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 NewRGBColor(r, g, b byte) colorRGB
- func RGB(s string, r, g, b byte) string
- func Rainbow(text string) string
- func RainbowMultiLine(text string) string
- func Red(s string) string
- func SetPosition(x, y int) string
- func Styles(s string, styles ...Style) 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 ( 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 ColorDepth ¶
func EnableColor ¶
func EnableColor() bool
func GradientMultiLine ¶
func GradientMultiLineRandom ¶
func GradientRandom ¶
func NewRGBColor ¶
func NewRGBColor(r, g, b byte) colorRGB
func RainbowMultiLine ¶
func SetPosition ¶
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
Click to show internal directories.
Click to hide internal directories.