Documentation ¶
Overview ¶
Package widget contains additional tview widgets.
Index ¶
- func AddColor(s, color string) string
- func GetHashColor(val interface{}) tcell.Color
- func GetHashColorName(s string) string
- func WriteLine(screen mauview.Screen, align int, line string, x, y, maxWidth int, ...)
- func WriteLineColor(screen mauview.Screen, align int, line string, x, y, maxWidth int, ...)
- func WriteLinePadded(screen mauview.Screen, align int, line string, x, y, maxWidth int, ...)
- func WriteLineSimple(screen mauview.Screen, line string, x, y int)
- func WriteLineSimpleColor(screen mauview.Screen, line string, x, y int, color tcell.Color)
- type Border
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHashColor ¶
GetHashColor gets the tcell Color value for the given string.
GetHashColor calls GetHashColorName() and gets the Color value from the tcell.ColorNames map.
func GetHashColorName ¶
GetHashColorName gets a color name for the given string based on its FNV-1 hash.
The array of possible color names are the alphabetically ordered color names specified in tcell.ColorNames.
The algorithm to get the color is as follows:
colorNames[ FNV1(string) % len(colorNames) ]
With the exception of the three special cases:
--> = green <-- = red --- = yellow
func WriteLineColor ¶
func WriteLinePadded ¶
Types ¶
type Border ¶
Border is a simple tview widget that renders a horizontal or vertical bar.
If the width of the box is 1, the bar will be vertical. If the height is 1, the bar will be horizontal. If the width nor the height are 1, nothing will be rendered.
func (*Border) OnMouseEvent ¶
func (border *Border) OnMouseEvent(event mauview.MouseEvent) bool
func (*Border) OnPasteEvent ¶
func (border *Border) OnPasteEvent(event mauview.PasteEvent) bool