Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(v2) feat: add color profiles and detect the terminal profile on program run #1142

Closed
wants to merge 1 commit into from

Conversation

aymanbagabas
Copy link
Member

@aymanbagabas aymanbagabas commented Sep 12, 2024

This defines tea.Profile and its consts. A color profile can downgrade color.Color based on terminal colors support. When the program starts, it will detect the color profile from the output and the program environment variables before sending the profile to the program model.

This also adds a startup example that demonstrates messages a program
receives during startup.

@aymanbagabas aymanbagabas force-pushed the colorprofile branch 2 times, most recently from 1751088 to eb8ba03 Compare September 12, 2024 21:12
@aymanbagabas aymanbagabas changed the title feat: add color profiles and detect the terminal profile on program run (v2) feat: add color profiles and detect the terminal profile on program run Sep 12, 2024
This defines `tea.Profile` and its consts. A color profile can downgrade
`color.Color` based on terminal colors support. When the program starts,
it will detect the color profile from the output and the program
environment variables before sending the profile to the program model.

This also adds a `startup` example that demonstrates messages a program
receive during startup.
aymanbagabas added a commit that referenced this pull request Sep 16, 2024
This adds support for detecting the terminal's color profile. It adds a
new `ColorProfileMsg` message that get sent when the program starts. You
can force a specific color profile using the `WithColorProfile` option.

When a program requests the `RGB` or `Tc` terminfo capabilities, Bubble
Tea will read the response, if there is one, and upgrade the cached
color profile and send the new profile to the program again.

Supersedes: #1142
Supersedes: #1143
@aymanbagabas aymanbagabas deleted the colorprofile branch September 16, 2024 21:37
aymanbagabas added a commit that referenced this pull request Oct 29, 2024
This adds support for detecting the terminal's color profile. It adds a
new `ColorProfileMsg` message that get sent when the program starts. You
can force a specific color profile using the `WithColorProfile` option.

When a program requests the `RGB` or `Tc` terminfo capabilities, Bubble
Tea will read the response, if there is one, and upgrade the cached
color profile and send the new profile to the program again.

Supersedes: #1142
Supersedes: #1143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants