styling

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HyphenHint = "Use a hyphen when typing a name with a space."
)

Variables

View Source
var (
	Green         = lipgloss.NewStyle().Foreground(lipgloss.Color("#38B000"))
	Red           = lipgloss.NewStyle().Foreground(lipgloss.Color("#D00000"))
	Gray          = lipgloss.Color("#777777")
	Yellow        = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#E1AD01", Dark: "#FFDE00"})
	ColoredBullet = lipgloss.NewStyle().
					SetString("•").
					Foreground(lipgloss.Color("#FFCC00"))
	CheckboxStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FFCC00"))
	KeyMenu       = lipgloss.NewStyle().Foreground(lipgloss.Color("#777777"))

	DocsLink = lipgloss.NewStyle().
				Foreground(lipgloss.AdaptiveColor{Light: "#E1AD01", Dark: "#FFCC00"}).
				Render("\x1b]8;;https://docs.poke-cli.com\x1b\\docs.poke-cli.com\x1b]8;;\x1b\\")

	StyleBold      = lipgloss.NewStyle().Bold(true)
	StyleItalic    = lipgloss.NewStyle().Italic(true)
	StyleUnderline = lipgloss.NewStyle().Underline(true)
	HelpBorder     = lipgloss.NewStyle().
					BorderStyle(lipgloss.RoundedBorder()).
					BorderForeground(lipgloss.Color("#FFCC00"))
	ErrorColor  = lipgloss.NewStyle().Foreground(lipgloss.Color("#F2055C"))
	ErrorBorder = lipgloss.NewStyle().
				BorderStyle(lipgloss.RoundedBorder()).
				BorderForeground(lipgloss.Color("#F2055C"))
	WarningColor  = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF8C00"))
	WarningBorder = lipgloss.NewStyle().
					BorderStyle(lipgloss.RoundedBorder()).
					BorderForeground(lipgloss.Color("#FF8C00"))
	TypesTableBorder = lipgloss.NewStyle().
						BorderStyle(lipgloss.NormalBorder()).
						BorderForeground(lipgloss.Color("#FFCC00"))
	ColorMap = map[string]string{
		"normal":   "#B7B7A9",
		"fire":     "#FF4422",
		"water":    "#3499FF",
		"electric": "#FFCC33",
		"grass":    "#77CC55",
		"ice":      "#66CCFF",
		"fighting": "#BB5544",
		"poison":   "#AA5699",
		"ground":   "#DEBB55",
		"flying":   "#889AFF",
		"psychic":  "#FF5599",
		"bug":      "#AABC22",
		"rock":     "#BBAA66",
		"ghost":    "#6666BB",
		"dragon":   "#7766EE",
		"dark":     "#775544",
		"steel":    "#AAAABB",
		"fairy":    "#EE99EE",
	}
)

Functions

func CapitalizeResourceName added in v1.8.5

func CapitalizeResourceName(name string) string

CapitalizeResourceName converts hyphenated resource names to title case Example: "strong-jaw" -> "Strong Jaw", "sword-of-ruin" -> "Sword of Ruin"

func FormTheme added in v1.5.0

func FormTheme() *huh.Theme

func GetTypeColor

func GetTypeColor(typeName string) string

GetTypeColor Helper function to get color for a given type name from colorMap

func StripANSI

func StripANSI(input string) string

StripANSI function is used in tests to strip ANSI for plain text processing

Types

type Color added in v1.0.3

type Color struct {
	R, G, B float64
}

Color To avoid unnecessary dependencies, I adapted the MakeColor function from "github.com/lucasb-eyer/go-colorful" and implemented it using only the standard library. Since I only needed this function, importing the entire library was unnecessary.

func MakeColor added in v1.0.3

func MakeColor(c color.Color) (Color, bool)

MakeColor constructs a Color from a color.Color.

func (Color) Hex added in v1.0.3

func (col Color) Hex() string

Hex returns the hex representation of the color, like "#ff0080".

func (Color) RGBA added in v1.0.3

func (col Color) RGBA() (uint32, uint32, uint32, uint32)

RGBA Implement the Go color.Color interface.

Jump to

Keyboard shortcuts

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