authors

package
v0.66.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorStyle

func AuthorStyle(authorName string) *style.TextStyle

func AuthorWithLength added in v0.43.0

func AuthorWithLength(authorName string, length int) string

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

func ColorPosition(authorName string) (hue, saturation, lightness float64)

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 LongAuthor(authorName string, length int) string

func SetCustomAuthors

func SetCustomAuthors(customAuthorColors map[string]string)

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

func ShortAuthor(authorName string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL