Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ColorOrange = Color{Light: censysOrangeDarker, Dark: censysOrange} ColorOffWhite = Color{Light: black, Dark: censysOffWhite} ColorSage = Color{Light: censysSageDarker, Dark: censysSage} ColorTeal = Color{Light: censysTeal, Dark: censysTeal} ColorAqua = Color{Light: censysAqua, Dark: censysAqua} ColorGold = Color{Light: censysGoldDarker, Dark: censysGold} ColorRed = Color{Light: red, Dark: red} ColorGray = Color{Light: gray, Dark: gray} ColorBlack = Color{Light: black, Dark: black} ColorBlue = Color{Light: blue, Dark: blue} )
Functions ¶
func ANSIPrefix ¶
ANSIPrefix returns the ANSI prefix for the given style.
func ColorDisabled ¶
func ColorDisabled() bool
ColorDisabled returns true if colored output should be disabled. This function is not responsible for determining if output is a TTY. Callers should perform their own check and call DisableStyles if needed.
func ColorForced ¶
func ColorForced() bool
ColorForced returns true if colored output should be forced.
func DisableStyles ¶
func DisableStyles()
DisableStyles disables ANSI styling by switching to an ASCII color profile. Should only be useful when the environment should allow colored output, but you want it to be explicitly disabled (i.e. if the output is not a TTY or if the user has explicitly disabled it).
func EnableStyles ¶
func EnableStyles()
EnableStyles enables ANSI styling by switching to a TrueColor color profile. Should only be used when the user explicitly forces color output.
func TemporarilyDisableStyles ¶
func TemporarilyDisableStyles() func()
TemporarilyDisableStyles temporarily disables ANSI styling by switching to an ASCII color profile. Callers must defer the returned function to restore the original color profile.
Types ¶
type Color ¶
type Color = lipgloss.AdaptiveColor
type Styles ¶
type Styles struct {
Signature lipgloss.Style
Primary lipgloss.Style
Secondary lipgloss.Style
Tertiary lipgloss.Style
Info lipgloss.Style
Warning lipgloss.Style
Danger lipgloss.Style
Comment lipgloss.Style
Indent4 lipgloss.Style
Indent8 lipgloss.Style
}
Styles describes the color palette and layout styles used by the CLI. These styles are consumed by formatter and command help rendering.
var GlobalStyles *Styles
GlobalStyles is the default palette used across CLI output. It is initialized during package init and can be overridden in tests.
func DefaultStyles ¶
func DefaultStyles() *Styles
DefaultStyles returns the default Censys-themed style palette.