Documentation ¶
Index ¶
- Variables
- func Colorize(value string, writer io.Writer, stripColors bool) (int, error)
- func Colorized(value string, stripColors bool) (string, error)
- func ColorizedOrStrip(value string, stripColors bool) string
- func StripColorCodes(value string) string
- type ColorTheme
- type CroppedLine
- type CroppedLines
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ColorRed = lipgloss.Color("1") ColorYellow = lipgloss.Color("3") ColorMagenta = lipgloss.Color("5") ColorCyan = lipgloss.Color("6") ColorOrange = lipgloss.Color("166") ColorLightGrey = lipgloss.Color("248") StyleCyan = lipgloss.NewStyle().Foreground(ColorCyan) StyleRed = lipgloss.NewStyle().Foreground(ColorRed) StyleOrange = lipgloss.NewStyle().Foreground(ColorOrange) StyleYellow = lipgloss.NewStyle().Foreground(ColorYellow) StyleMagenta = lipgloss.NewStyle().Foreground(ColorMagenta) StyleLightGrey = lipgloss.NewStyle().Foreground(ColorLightGrey) StyleBold = lipgloss.NewStyle().Bold(true) StyleActionable = lipgloss.NewStyle().Bold(true).Foreground(ColorCyan) )
Functions ¶
func Colorize ¶
Colorize will replace `[COLORNAME]foo`[/RESET] with shell colors, or strip color tags if stripColors=true
func ColorizedOrStrip ¶
func StripColorCodes ¶
StripColorCodes strips color codes from a string
Types ¶
type ColorTheme ¶
type ColorTheme interface { Heading(writer io.Writer) Bold(writer io.Writer) Notice(writer io.Writer) Success(writer io.Writer) Error(writer io.Writer) Warning(writer io.Writer) Disabled(writer io.Writer) Actionable(writer io.Writer) Cyan(writer io.Writer) Green(writer io.Writer) Red(writer io.Writer) Orange(writer io.Writer) Yellow(writer io.Writer) Magenta(writer io.Writer) Reset(writer io.Writer) }
type CroppedLine ¶
type CroppedLines ¶
type CroppedLines []CroppedLine
func GetCroppedText ¶
func GetCroppedText(text string, maxLen int, includeLineEnds bool) CroppedLines
func (CroppedLines) String ¶
func (c CroppedLines) String() string
Click to show internal directories.
Click to hide internal directories.