Documentation
¶
Index ¶
- Variables
- func ColorizeText(text, hex string) string
- func DisableColors()
- func FormatColoredTag(tag, hex string) string
- func Gray(text string) string
- func HexToRGB(hex string) (r, g, b int, err error)
- func Italic(text string) string
- func NormalizeColor(color string) (string, error)
- func PrintColoredTag(tag, hex string)
- func ShouldUseColors() bool
- func TerminalColorBlock(hex string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var NamedColorMap = map[string]string{
"red": "#FF0000",
"blue": "#0000FF",
"green": "#008000",
"yellow": "#FFFF00",
"orange": "#FFA500",
"purple": "#800080",
"pink": "#FFC0CB",
"cyan": "#00FFFF",
"magenta": "#FF00FF",
"lime": "#00FF00",
"teal": "#008080",
"navy": "#000080",
"maroon": "#800000",
"olive": "#808000",
"silver": "#C0C0C0",
"gray": "#808080",
"grey": "#808080",
"black": "#000000",
"white": "#FFFFFF",
"darkgray": "#A9A9A9",
"darkgrey": "#A9A9A9",
"lightgray": "#D3D3D3",
"lightgrey": "#D3D3D3",
"gold": "#FFD700",
"brown": "#A52A2A",
"coral": "#FF7F50",
"crimson": "#DC143C",
"indigo": "#4B0082",
"ivory": "#FFFFF0",
"khaki": "#F0E68C",
"lavender": "#E6E6FA",
"salmon": "#FA8072",
"tan": "#D2B48C",
"tomato": "#FF6347",
"violet": "#EE82EE",
"wheat": "#F5DEB3",
}
NamedColorMap maps HTML color names to hex codes
Functions ¶
func ColorizeText ¶
ColorizeText returns ANSI escape sequence for colored text
func FormatColoredTag ¶
FormatColoredTag returns a formatted string with colored indicator
func NormalizeColor ¶
NormalizeColor converts a color string (hex or named) to hex format (without leading #)
func PrintColoredTag ¶
func PrintColoredTag(tag, hex string)
PrintColoredTag prints a tag with colored indicator
func ShouldUseColors ¶
func ShouldUseColors() bool
ShouldUseColors returns true if colored output should be used
func TerminalColorBlock ¶
TerminalColorBlock returns ANSI escape sequence for terminal color visualization
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.