-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Renamed enum color to colors. #774
Conversation
07f36d2
to
7d13715
Compare
Added enum colors conversion to rgb struct. Added colors_test.cpp.
0a04018
to
ef2f510
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest keeping the name color
because enum names are normally singular in the standard (see http://eel.is/c++draft/utilities#meta.endian and http://eel.is/c++draft/atomics#order) except for bitmask types.
Agree name |
I suggest removing the old |
What about Another more complicated idea would be to allow multiple colors per line. // Something like this ?
fmt::print("{:color::red}, {:color::green}, {:color::blue} \n","red","green","blue");
``` |
I don't think we need |
Renamed enum colors back to color.
What do we miss here ? |
specify foreground color 'fd'. | ||
Example: | ||
fmt::print(fmt::color::red, "Elapsed time: {0:.2f} seconds", 1.23); | ||
*/ | ||
template <typename... Args> | ||
inline void print(rgb fd, string_view format_str, const Args & ... args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have both print
and print_rgb
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print_rgb is now removed.
You could try fixing the g++ 4.8 build. https://github.com/Remotion/fmt-fork/blob/74107c9bd8c1df2b74d3cb4c0d98f0dcc60813d7/include/fmt/colors.h#L39-L43
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but Travis build seems broken.
Removed print_rgb.
Merged in ce50063 with minor tweaks to prevent breaking the API (we can remove the old color API during the next major release). Thanks! |
Is it really necessary to wait for the next major release, though? The previous color API was not documented anywhere, so the feature wasn't really stabilized and it wouldn't really be a breaking change to remove it. |
It is still part of the public API, so I'd rather remove it in stages. Maybe not in the major version but at least we need to provide a good migration plan. |
I added a comment that the old color code is deprecated (https://github.com/fmtlib/fmt/blob/master/include/fmt/core.h#L1185) and we can make |
@Remotion, could you please review the updated CONTIBUTING document, particularly the part about licensing, and let me know if you agree with it being applied to your contributions to {fmt}? The library is likely to be relicensed (#1073) so I'm collecting approval from all earlier contributors. |
Added enum colors conversion to rgb struct.
Added colors_test.cpp.
Now it looks a bit strange.
We have
enum color
from format.h andenum class colors
from colors.h.