Documentation ¶
Overview ¶
Package text implements text manipulation for the command line.
Index ¶
- Constants
- func Black(text string) string
- func Blue(text string) string
- func Bold(text string) string
- func Cyan(text string) string
- func Green(text string) string
- func Purple(text string) string
- func Raw(rendition string, display string, background string, text string) string
- func Red(text string) string
- func White(text string) string
- func Yellow(text string) string
Examples ¶
Constants ¶
View Source
const ( // rendition modes RndDFL = "0" // default rendition RndBLD = "1" // bold or increased intensity RndDCR = "2" // faint, decreased intensity or second color RndITL = "3" // italics RndUND = "4" // underlined RndBLN = "5" // slowly blinking (less than 150 per minute) RndNGT = "7" // negative image RndCNC = "8" // concealed data (hidden) // display colors DspBLK = "30" // black display DspRED = "31" // red display DspGRN = "32" // green display DspYLW = "33" // yellow display DspBLE = "34" // blue display DspPRE = "35" // purple display DspCYN = "36" // cyan display DspWHT = "37" // white display // background colors BckBLK = "40" // black background BckRED = "41" // red background BckGRN = "42" // green background BckYLW = "43" // yellow background BckBLE = "44" // blue background BckPRE = "45" // purple background BckCYN = "46" // cyan background BckWHT = "47" // white background )
Variables ¶
This section is empty.
Functions ¶
func Purple ¶ added in v0.2.0
Purple returns purple text
Example ¶
fmt.Println(Purple("Purple"))
Output:
func Raw ¶ added in v0.2.0
Raw gives full control of the returned text by directly exposing all tokens. The constant section holds the ECMA-48 SGR - Select Graphic Rendition values but feel free to experiment and use your own values.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.