Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressBar ¶
type ProgressBar struct {
Width int
Percentage float64
FillColor color.Color
EmptyColor color.Color
}
func (ProgressBar) Render ¶
func (p ProgressBar) Render() string
type SegmentedOption ¶ added in v0.1.3
type SegmentedOption func(*SegmentedProgressBar)
func WithSegmentWidth ¶ added in v0.1.3
func WithSegmentWidth(w int) SegmentedOption
func WithSegmentedColors ¶ added in v0.1.3
func WithSegmentedColors(poor, sufficient, optimal color.Color) SegmentedOption
func WithSegmentedThresholds ¶ added in v0.1.3
func WithSegmentedThresholds(sufficient, optimal float64) SegmentedOption
WithSegmentedThresholds sets custom thresholds for sufficient and optimal.
type SegmentedProgressBar ¶ added in v0.1.3
type SegmentedProgressBar struct {
Width int
Percentage float64
PoorColor color.Color // below SufficientThreshold
SufficientColor color.Color // SufficientThreshold to OptimalThreshold
OptimalColor color.Color // above OptimalThreshold
DimColor color.Color
SegmentWidth int
SufficientThreshold float64 // threshold for sufficient (default 70)
OptimalThreshold float64 // threshold for optimal (default 85)
}
SegmentedProgressBar represents a 3-segment progress bar where only the active segment is highlighted based on the percentage range
func NewSegmented ¶ added in v0.1.3
func NewSegmented(percentage float64, opts ...SegmentedOption) SegmentedProgressBar
func (SegmentedProgressBar) Render ¶ added in v0.1.3
func (s SegmentedProgressBar) Render() string
Click to show internal directories.
Click to hide internal directories.