charmbracelet / charmbracelet/bubbles

Non-24bit color support for charmbracelet/bubbles/progress

Open
#143 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
8.9k
Forks
457
Avg merge
1d 18h
Merged PRs (30d)
5

Description

`progress` currently has the option to define a custom gradient using `WithGradient`, which accepts two colors as strings. These are then [passed to `colorful.Hex`](https://github.com/charmbracelet/bubbles/blob/master/progress/progress.go#L332-L333) – which (perhaps obviously) doesn’t accept ANSI colors. Thus, creating ANSI gradients (for example, from `5` to `13` , regular to bright magenta) isn’t supported and the bar will fall back to a black fill.

On the other hand, passing ANSI colors to `WithSolidFill` works perfectly, as it is not run through `colorful.Hex` before rendering.

`go-colorful`, the library used to generate the gradient for `progress`, does not currently work with ANSI colors.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.