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

Default to terminal foreground color for tilde, underline, colon and info #604

Merged
merged 2 commits into from
Mar 5, 2022

Conversation

o2sh
Copy link
Owner

@o2sh o2sh commented Mar 5, 2022

As suggested here

@o2sh o2sh requested a review from spenserblack March 5, 2022 15:11
@o2sh o2sh changed the title default to terminal foreground color for tilde, underline, colon and info Default to terminal foreground color for tilde, underline, colon and info Mar 5, 2022
Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

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

Looks good!

I think this is good to merge as-is, but you might want to check out spenserblack@42711cf.

Maybe I over-engineered a bit, but the basic idea was to create our own Colorize trait that "inherits" from colored::Colorize, allowing us to pass options and keep the style of s.fn vs fn(s).

diff to main

Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

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

That was probably a good idea to rename to try_color to avoid naming conflicts 👍

@o2sh
Copy link
Owner Author

o2sh commented Mar 5, 2022

Thanks @spenserblack, and you're right s.fn instead fn(s) is indeed cleaner. I took inspiration from what you did and added the ColorizeOption trait but without overriding the Colorize interface.

@o2sh o2sh merged commit 0ef5f58 into main Mar 5, 2022
@o2sh o2sh deleted the fix/text-coloring branch March 5, 2022 22:00
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.

None yet

2 participants