Documentation
¶
Index ¶
- func AuthorStyle(authorName string) *style.TextStyle
- func AuthorWithLength(authorName string, length int) string
- func ColorPosition(authorName string) (hue, saturation, lightness float64)
- func ColorsVersion() int
- func LongAuthor(authorName string, length int) string
- func SetCustomAuthors(customAuthorColors map[string]string)
- func SetLightBackground(light bool)
- func ShortAuthor(authorName string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorStyle ¶
func AuthorWithLength ¶ added in v0.43.0
AuthorWithLength returns a representation of the author that fits into a given maximum length: - if the length is less than 2, it returns an empty string - if the length is 2, it returns the initials - otherwise, it returns the author name truncated to the maximum length
func ColorPosition ¶ added in v0.66.0
ColorPosition says where an author's color lies within the range of hues, saturations and lightnesses that colorAtPosition picks from. Each is a fraction from 0 up to 1, derived from a hash of the author's name.
func ColorsVersion ¶ added in v0.66.0
func ColorsVersion() int
ColorsVersion changes whenever the colors of authors change, so that whatever keeps the styles of authors around can tell when they are out of date.
func LongAuthor ¶
func SetCustomAuthors ¶
func SetLightBackground ¶ added in v0.66.0
func SetLightBackground(light bool)
SetLightBackground says whether the terminal has a light background, for the colors of authors to stand out against.
func ShortAuthor ¶
Types ¶
This section is empty.