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

add colours e.g. fmt::colour(fmt::red) #20

Closed
wants to merge 1 commit into from
Closed

Conversation

jose55
Copy link

@jose55 jose55 commented Feb 15, 2014

Now in main() we can write:

int main()
{

fmt::colour(fmt::red); //red, green, blue, yellow,cyan, magenta, white ...

fmt::Print("hello");

fmt::colour(fmt::white); // to get back the white colour

return 0;
}

@vitaut
Copy link
Contributor

vitaut commented Feb 19, 2014

Thanks for the suggestion. I only think that it's better to pass color to the print method instead of setting it globally, so I implemented a variant of the Print method called PrintColored based on your idea: 6968ef3. It can be used as follows:

fmt::PrintColored(fmt::RED, "Hello, {}!\n") << "world";

@vitaut vitaut closed this Feb 19, 2014
@jose55
Copy link
Author

jose55 commented Feb 24, 2014

Yes , much better than the way I did.
But it was easier for me!!!!!

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