-
Notifications
You must be signed in to change notification settings - Fork 143
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
storing color in variable #103
Comments
This is a great idea, will definitely reduce noise in those
Afaik the |
Ok but beware:
But I'm not sure this is thread safe. Here is my attempt with all cited points: |
@Lecrapouille , may you please to take a look at my pull request? It implements exactly that. May be you could help me with naming and (good) design? |
@HemilTheRebel is this one #107 ? Ok I'll give a try. |
Yes. It is the one i am talking about. Even i forgot to reference my PR. |
@HemilTheRebel I've never deal with PR, but it seems you changed indentation of the original code (I had to activate the option "hide whitespace changes" to see you real changes). You should have create a special PR just for fixing indentation, else it will difficult for people understanding your change once in git history. Also try to follow the author coding style "if(" vs "if (" same for the "for" and for comments. Except that I see nothing wrong with design when reading your code. Just some minor improvements:
I'm not the author of this library so the final world does not belong to me. |
Thank you so much @Lecrapouille . I made the following changes:
|
@HemilTheRebel seems good to be ! Maybe m_finalColor can be directly be a stream, this could avoid conversion stream -> string -> stream |
Done. How can I not figure that out? Stupid me. Thanks a lot |
Hi ! this is not an issue. I get inspired by your library. I need to store style and fg color in a variable for a postponed usage. Here is the idea:
So why not adding in your lib something like:
A simple test code could be:
I dunno what could be the best:
std::pair
(ugly and long syntax but can be used with constexpr) orstruct
(drawback: make copy). personally I would prefer something likered | italic
(but can achieve easily). Other solution ?(Maybe your lib already can do this, in this case ignore my comment)
The text was updated successfully, but these errors were encountered: