Skip to content
New issue

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

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

Already on GitHub? # to your account

Tolerate leading zeros in numeric color parameters #8

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

jeffwilliams
Copy link

This change allows leading zeros in parameters. I.e. it will accept ESC [032m as if it were ESC [32m .

This is mostly to support https://github.com/aybabtme/rgbterm which uses the sequence ESC [0;00m to reset the terminal colors to default:

https://github.com/aybabtme/rgbterm/blob/cc83f3b3ce5911279513a46d6d3316d67bedaa54/rgbterm.go#L36

Really, the change could just as easily be made in rgbterm. But it seems like most terminals support having that leading zero (since rgbterm works in them), so it's likely that leading zeros would show up in other places like other colorizing implementations or people's scripts.

Copy link
Owner

@leaanthony leaanthony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thank you 🙏

@leaanthony leaanthony merged commit c9c4f7e into leaanthony:main Jun 9, 2023
@leaanthony
Copy link
Owner

I've just published v1.6.1. Many thanks again 🙏

@jeffwilliams
Copy link
Author

jeffwilliams commented Jun 9, 2023 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants