Renamed enum color to colors.

Added enum colors conversion to rgb struct.
Added colors_test.cpp.

Removed print_colored.
Renamed enum colors back to color.

Removed unnecessary inline keyword.
Removed print_rgb.
This commit is contained in:
Remotion
2018-06-09 00:33:39 +02:00
committed by Victor Zverovich
parent 0508bbc7ae
commit ce500635c7
5 changed files with 237 additions and 243 deletions

View File

@@ -5,6 +5,7 @@
//
// For the license information refer to format.h.
#define FMT_EXTENDED_COLORS
#define FMT_NOEXCEPT
#undef FMT_SHARED
#include "test-assert.h"
@@ -116,3 +117,10 @@ TEST(FormatTest, FormatErrorCode) {
EXPECT_EQ(msg, to_string(buffer));
}
}
TEST(ColorsTest, Colors) {
EXPECT_WRITE(stdout, fmt::print(fmt::rgb(255,20,30), "rgb(255,20,30)"),
"\x1b[38;2;255;020;030mrgb(255,20,30)\x1b[0m");
EXPECT_WRITE(stdout, fmt::print(fmt::color::blue,"blue"),
"\x1b[38;2;000;000;255mblue\x1b[0m");
}