MCPcopy Create free account
hub / github.com/charmbracelet/bubbles / WithColorFunc

Function WithColorFunc

progress/progress.go:125–130  ·  view source on GitHub ↗

WithColorFunc sets a function that can be used to dynamically fill the progress bar based on the current percentage. total is the total filled percentage, and current is the current percentage that is actively being filled with a color. When specified, this overrides any other defined colors and sca

(fn ColorFunc)

Source from the content-addressed store, hash-verified

123// return lipgloss.Color("#0000FF")
124// }),
125func WithColorFunc(fn ColorFunc) Option {
126 return func(m *Model) {
127 m.colorFunc = fn
128 m.blend = nil
129 }
130}
131
132// WithFillCharacters sets the characters used to construct the full and empty
133// components of the progress bar.

Callers 1

TestBlendFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestBlendFunction · 0.68