Documentation
¶
Overview ¶
Package design provides reusable visual design components.
Package design provides reusable UI design components.
Index ¶
- func AdaptiveGradientColors() (startHex, endHex string)
- func ApplyGradientToMultilineText(text string) string
- func ApplyGradientToText(text string) string
- func RenderGradientBar(cfg GradientBarConfig) string
- func RenderHeader(text string, width int) string
- func RenderHeaderCentered(text string, width int) string
- func RenderHeaderDim(text string, width int) string
- func RenderSimpleGradientBar(value float64, width int) string
- type GradientBarConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdaptiveGradientColors ¶
func AdaptiveGradientColors() (startHex, endHex string)
AdaptiveGradientColors returns the appropriate gradient start/end hex colors based on the terminal background (light or dark). Dark terminals get bright vibrant colors, light terminals get darker saturated colors.
func ApplyGradientToMultilineText ¶
ApplyGradientToMultilineText applies a gradient color to multi-line text. Each line gets a color based on its position in the text (line-by-line gradient).
func ApplyGradientToText ¶
ApplyGradientToText applies a gradient color to text, character by character.
func RenderGradientBar ¶
func RenderGradientBar(cfg GradientBarConfig) string
RenderGradientBar creates a comparison bar with gradient coloring. The bar shows proportional representation of two values with smooth color transition.
func RenderHeader ¶
RenderHeader renders a header with gradient text followed by diagonal fill. text is the header text to display. width is the total width to fill. Returns a styled header string with gradient text and diagonal lines.
func RenderHeaderCentered ¶
RenderHeaderCentered renders a header with diagonal fills on both sides. text is the header text to display centered. width is the total width to fill.
func RenderHeaderDim ¶
RenderHeaderDim renders a dimmed header for unfocused state. text is the header text to display. width is the total width to fill.
func RenderSimpleGradientBar ¶
RenderSimpleGradientBar creates a single-direction gradient bar. Useful for percentage displays like possession.
Types ¶
type GradientBarConfig ¶
type GradientBarConfig struct {
Width int // Total width of the bar
HomeValue float64 // Home team value (for ratio calculation)
AwayValue float64 // Away team value (for ratio calculation)
StartColor string // Hex color for start (home side), e.g., "#00FFFF"
EndColor string // Hex color for end (away side), e.g., "#FF0055"
FilledChar string // Character for filled portion (default: "█")
EmptyChar string // Character for empty portion (default: "░")
}
GradientBarConfig configures how a gradient comparison bar is rendered.
func DefaultGradientBarConfig ¶
func DefaultGradientBarConfig(width int, homeVal, awayVal float64) GradientBarConfig
DefaultGradientBarConfig returns a default configuration with theme colors.