design

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package design provides reusable visual design components.

Package design provides reusable UI design components.

Index

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

func ApplyGradientToMultilineText(text string) string

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

func ApplyGradientToText(text string) string

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

func RenderHeader(text string, width int) string

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

func RenderHeaderCentered(text string, width int) string

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

func RenderHeaderDim(text string, width int) string

RenderHeaderDim renders a dimmed header for unfocused state. text is the header text to display. width is the total width to fill.

func RenderSimpleGradientBar

func RenderSimpleGradientBar(value float64, width int) string

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.

Jump to

Keyboard shortcuts

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