diff --git a/progress/example/main.go b/progress/example/main.go index 4e18a93..5514ded 100644 --- a/progress/example/main.go +++ b/progress/example/main.go @@ -18,7 +18,7 @@ const ( ) func main() { - progress, err := progress.NewModel(progress.WithDefaultRamp()) + progress, err := progress.NewModel(progress.WithDefaultGradient()) if err != nil { fmt.Println("Could not initialize progress model:", err) os.Exit(1) diff --git a/progress/progress.go b/progress/progress.go index 38ca7f0..49da0d9 100644 --- a/progress/progress.go +++ b/progress/progress.go @@ -21,27 +21,27 @@ var color func(string) termenv.Color = termenv.ColorProfile().Color // ) type Option func(*Model) error -// WithDefaultRamp sets a gradient fill with default colors. -func WithDefaultRamp() Option { - return WithRamp("#00dbde", "#fc00ff") +// WithDefaultGradient sets a gradient fill with default colors. +func WithDefaultGradient() Option { + return WithGradient("#00dbde", "#fc00ff") } -// WithRamp sets a gradient fill blending between two colors. -func WithRamp(colorA, colorB string) Option { +// WithGradient sets a gradient fill blending between two colors. +func WithGradient(colorA, colorB string) Option { return func(m *Model) error { return m.setRamp(colorA, colorB, false) } } -// WithDefaultScaledRamp sets a gradient with default colors, and scales the +// WithDefaultScaledGradient sets a gradient with default colors, and scales the // gradient to fit the filled portion of the ramp. -func WithDefaultScaledRamp() Option { - return WithScaledRamp("#00dbde", "#fc00ff") +func WithDefaultScaledGradient() Option { + return WithScaledGradient("#00dbde", "#fc00ff") } -// WithScaledRamp scales the gradient to fit the width of the filled portion of +// WithScaledGradient scales the gradient to fit the width of the filled portion of // the progress bar. -func WithScaledRamp(colorA, colorB string) Option { +func WithScaledGradient(colorA, colorB string) Option { return func(m *Model) error { return m.setRamp(colorA, colorB, true) }