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

BackgroundColor should return err instead of default #167

Open
eslam-allam opened this issue Apr 8, 2024 · 1 comment
Open

BackgroundColor should return err instead of default #167

eslam-allam opened this issue Apr 8, 2024 · 1 comment

Comments

@eslam-allam
Copy link

The current implementation of BackgroundColor/ForegroundColor attempts to get the default color using a status report, or COLORFGBG if exists, or finally a default color if all else fails. I think this is problematic because I don't know whether the color I received was correct or not. This would make it impossible for me to restore the user's terminal to it's original colors. A much better approach in my opinion is to return an error telling me that the true color couldn't be fetched, giving me the chance to refrain from changing it in the first place.

@eslam-allam
Copy link
Author

Is this repo no longer accepting issues?

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

No branches or pull requests

1 participant