feat: add more info about colors in sgr sequences#40
Merged
caarlos0 merged 1 commit intocharmbracelet:mainfrom Dec 2, 2024
Merged
Conversation
Pull Request Test Coverage Report for Build 12091316136Details
💛 - Coveralls |
Implement changes based on issue charmbracelet#16 and fix SGR 59. - fix unhandled runtime error in SGR 59 - replace unformatted RGB values for truecolor with hex values - add matching hex values for ANSI256 colors - add info about type of color being used (ANSI, ANSI256, 24-bit RGB) - adjust test data Signed-off-by: Michał Kotowski <dev@mkotowski.dev>
7e30d00 to
46f1409
Compare
caarlos0
approved these changes
Dec 2, 2024
caarlos0
reviewed
Dec 2, 2024
| str += "Default underline color" | ||
| case 90, 91, 92, 93, 94, 95, 96, 97: | ||
| str += fmt.Sprintf("Bright foreground color: %s", basicColors[param.Param(0)-90]) | ||
| str += fmt.Sprintf("Bright ANSI foreground color: %s", basicColors[param.Param(0)-90]) |
Contributor
There was a problem hiding this comment.
i would maybe change this
Suggested change
| str += fmt.Sprintf("Bright ANSI foreground color: %s", basicColors[param.Param(0)-90]) | |
| str += fmt.Sprintf("ANSI foreground color: Bright %s", basicColors[param.Param(0)-90]) |
caarlos0
reviewed
Dec 2, 2024
| str += fmt.Sprintf("Bright ANSI foreground color: %s", basicColors[param.Param(0)-90]) | ||
| case 100, 101, 102, 103, 104, 105, 106, 107: | ||
| str += fmt.Sprintf("Bright background color: %s", basicColors[param.Param(0)-100]) | ||
| str += fmt.Sprintf("Bright ANSI background color: %s", basicColors[param.Param(0)-100]) |
Contributor
There was a problem hiding this comment.
Suggested change
| str += fmt.Sprintf("Bright ANSI background color: %s", basicColors[param.Param(0)-100]) | |
| str += fmt.Sprintf("ANSI background color: Bright %s", basicColors[param.Param(0)-100]) |
aymanbagabas
approved these changes
Dec 2, 2024
Contributor
|
done the bright thing on |
Member
|
This is such great revision. Thanks, @mkotowski!! |
Contributor
|
True that! Thanks so much @mkotowski ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement changes based on issue #16 and fix SGR 59.
SGR 59 was not handled correctly:

Example of output after changes: