Documentation
¶
Index ¶
- Variables
- func ButtonView(text string, focused bool) string
- func CancelButtonView(focused bool, defaultButton bool) string
- func Code(s string) string
- func HelpView(sections ...string) string
- func KeyValueView(stuff ...string) string
- func Keyword(s string) string
- func NoButtonView(focused bool) string
- func OKButtonView(focused bool, defaultButton bool) string
- func Subtle(s string) string
- func VerticalLine(state State) string
- func Wrap(s string) string
- func YesButtonView(focused bool) string
- type ColorPair
- type State
Constants ¶
This section is empty.
Variables ¶
var ( // Color wraps termenv.ColorProfile.Color, which produces a termenv color // for use in termenv styling. Color func(string) te.Color = te.ColorProfile().Color // HasDarkBackground stores whether or not the terminal has a dark // background. HasDarkBackground = te.HasDarkBackground() )
var ( Indigo ColorPair = NewColorPair("#7571F9", "#5A56E0") SubtleIndigo = NewColorPair("#514DC1", "#7D79F6") Cream = NewColorPair("#FFFDF5", "#FFFDF5") YellowGreen = NewColorPair("#ECFD65", "#04B575") Fuschia = NewColorPair("#EE6FF8", "#EE6FF8") Green = NewColorPair("#04B575", "#04B575") Red = NewColorPair("#ED567A", "#FF4672") FaintRed = NewColorPair("#C74665", "#FF6F91") SpinnerColor = NewColorPair("#747373", "#8E8E8E") NoColor = NewColorPair("", "") )
Colors for dark and light backgrounds.
var ( IndigoFg func(string) string = te.Style{}.Foreground(Indigo.Color()).Styled SubtleIndigoFg = te.Style{}.Foreground(SubtleIndigo.Color()).Styled RedFg = te.Style{}.Foreground(Red.Color()).Styled FaintRedFg = te.Style{}.Foreground(FaintRed.Color()).Styled )
Functions for styling strings.
var Spinner = spinner.Dot
Functions ¶
func ButtonView ¶
ButtonView renders something that resembles a button.
func CancelButtonView ¶
CancelButtonView returns a button reading "Cancel.".
func HelpView ¶
HelpView renders text intended to display at help text, often at the bottom of a view.
func NoButtonView ¶
NoButtonView returns a button reading "No.".
func OKButtonView ¶
OKButtonView returns a button reading "OK".
func VerticalLine ¶
VerticalLine return a vertical line colored according to the given state.
func YesButtonView ¶
YesButtonView return a button reading "Yes".
Types ¶
type ColorPair ¶
ColorPair is a pair of colors, one intended for a dark background and the other intended for a light background. We'll automatically determine which of these colors to use.
func NewColorPair ¶
NewColorPair is a helper function for creating a ColorPair.