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

Adds option to configure the Foreground Done Color #97

Merged
merged 4 commits into from
Jun 7, 2022

Conversation

gfs
Copy link
Contributor

@gfs gfs commented May 25, 2022

Adds an option to configure the Foreground Done Color in the same Style as the configurable Foreground color.
Adds an example for its usage.

Motivation:
Sometimes a task may fail, but the Done color must be configured ahead of time. The color of the progress bar may then mislead the user into thinking the process was successful when it was not.

gfs and others added 4 commits May 25, 2022 04:31
You may want to represent a different state in some instances, for example a failed operation having a red bar but a successful one with a green bar.

Rather than adding the concept of "failed" vs "finished" to the progress bar, this adds a getter and setter like that for the dynamic foreground color.
Adds ForegroundColorError as another option that can be toggled through
`pbar.ObservedError = true` or `pbar.WriteErrorLine()`
@Mpdreamz
Copy link
Owner

Mpdreamz commented Jun 7, 2022

Thanks for the PR @gfs

I updated it slightly so that error state is modeled a bit more explicitly

Adds ForegroundColorError as another option that can be toggled through
pbar.ObservedError = true or pbar.WriteErrorLine()

This way you don't need to call .Finished() before being able to set the done color.

@Mpdreamz Mpdreamz merged commit a008b50 into Mpdreamz:master Jun 7, 2022
@gfs
Copy link
Contributor Author

gfs commented Jun 7, 2022

Looks great - I like the explicit error option. Looking forward to trying it out when it hits nuget!

@Mpdreamz
Copy link
Owner

Mpdreamz commented Jun 8, 2022

New version should be up! Thanks again for the PR :)

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