theme

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package theme provides centralized styling, colors, and formatting for the TUI.

Index

Constants

View Source
const (
	// ColorPrimary is the primary brand color
	ColorPrimary = "#7C3AED"
	// ColorDarkBg is the dark background color
	ColorDarkBg = "#1E1E2E"
	// ColorSuccess indicates successful operations
	ColorSuccess = "#10B981"
	// ColorInfo indicates informational states
	ColorInfo = "#3B82F6"
	// ColorLightBlue is a lighter blue shade
	ColorLightBlue = "#60A5FA"
	// ColorError indicates error states
	ColorError = "#EF4444"
	// ColorWarning indicates warning states
	ColorWarning = "#F59E0B"
	// ColorYellow is yellow
	ColorYellow = "#FBBF24"
	// ColorGray is the standard gray color
	ColorGray = "#6B7280"
	// ColorLightGray is a lighter gray shade
	ColorLightGray = "#9CA3AF"
	// ColorWhite is white
	ColorWhite = "#F3F4F6"
	// ColorIndigo is an indigo shade
	ColorIndigo = "#6366F1"
	// ColorViolet is a violet shade
	ColorViolet = "#A78BFA"
	// ColorEmerald is an emerald shade
	ColorEmerald = "#34D399"
	// ColorSky is a sky blue shade
	ColorSky = "#93C5FD"
)

Color palette for the TUI

View Source
const (

	// PercentageMultiplier converts ratio to percentage
	PercentageMultiplier = 100
	// MinEllipsisLength is the minimum length to show ellipsis
	MinEllipsisLength = 3
	// ThousandSeparatorInterval is the digit count between thousand separators
	ThousandSeparatorInterval = 3
)
View Source
const (
	// BoxPaddingHorizontal is the horizontal padding for bordered boxes
	BoxPaddingHorizontal = 2
	// BoxPaddingVertical is the vertical padding for bordered boxes
	BoxPaddingVertical = 1
)

Variables

View Source
var (
	// TitleStyle is used for section titles
	TitleStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color(ColorPrimary))
	// SuccessStyle indicates successful operations
	SuccessStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(ColorSuccess)).Bold(true)
	// ErrorStyle indicates error states
	ErrorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(ColorError)).Bold(true)
	// WarningStyle indicates warning states
	WarningStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(ColorWarning)).Bold(true)
	// InfoStyle indicates informational states
	InfoStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(ColorInfo))
	// LabelStyle is used for labels
	LabelStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(ColorLightGray))
	// ValueStyle is used for values
	ValueStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(ColorWhite)).Bold(true)
	// BorderedBoxStyle is a box with rounded borders and padding
	BorderedBoxStyle = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						Padding(BoxPaddingVertical, BoxPaddingHorizontal)
	// SubtleTextStyle is used for less prominent text
	SubtleTextStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(ColorGray))
)

Functions

func BorderColorError

func BorderColorError() lipgloss.Color

BorderColorError returns the border color for error states

func BorderColorFocused

func BorderColorFocused() lipgloss.Color

BorderColorFocused returns the border color for focused elements

func BorderColorSuccess

func BorderColorSuccess() lipgloss.Color

BorderColorSuccess returns the border color for success states

func BorderColorUnfocused

func BorderColorUnfocused() lipgloss.Color

BorderColorUnfocused returns the border color for unfocused elements

func CompactString

func CompactString(s string) string

CompactString removes excess whitespace from a string

func FormatCost

func FormatCost(cost float64) string

FormatCost formats a cost value as currency (e.g., "$0.0123")

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration formats a duration as a human-readable string (e.g., "500ms", "2s")

func FormatNumber

func FormatNumber(n int64) string

FormatNumber formats a large number with thousand separators (e.g., "1,234,567")

func FormatPercentage

func FormatPercentage(numerator, denominator int) string

FormatPercentage formats a ratio as a percentage (e.g., "66.7%")

func TruncateString

func TruncateString(s string, maxLen int) string

TruncateString truncates a string to maxLen characters with ellipsis

Types

This section is empty.

Jump to

Keyboard shortcuts

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