|
|
@ -17,6 +17,8 @@ using namespace fmt; |
|
|
|
using namespace ftxui; |
|
|
|
using namespace ftxui; |
|
|
|
|
|
|
|
|
|
|
|
std::string generate_colors() { |
|
|
|
std::string generate_colors() { |
|
|
|
|
|
|
|
REQUIRE(ftxui::Terminal::ColorSupport() == Terminal::Color::TrueColor); |
|
|
|
|
|
|
|
|
|
|
|
const int max_value = 255; |
|
|
|
const int max_value = 255; |
|
|
|
const int value_increment = 8; |
|
|
|
const int value_increment = 8; |
|
|
|
const int hue_increment = 6; |
|
|
|
const int hue_increment = 6; |
|
|
@ -36,8 +38,6 @@ std::string generate_colors() { |
|
|
|
array.push_back(hbox(std::move(line))); |
|
|
|
array.push_back(hbox(std::move(line))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
println("MADE {} CHARS", count); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto true_color_display = vbox({ |
|
|
|
auto true_color_display = vbox({ |
|
|
|
vbox(std::move(array)), |
|
|
|
vbox(std::move(array)), |
|
|
|
}); |
|
|
|
}); |
|
|
@ -52,13 +52,14 @@ std::string generate_colors() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TEST_CASE("test out ragel parser", "[gui]") { |
|
|
|
TEST_CASE("test out ragel parser", "[gui]") { |
|
|
|
std::string colors = generate_colors(); |
|
|
|
|
|
|
|
std::cout << colors; |
|
|
|
|
|
|
|
sf::Color default_fg(0,0,0); |
|
|
|
sf::Color default_fg(0,0,0); |
|
|
|
sf::Color default_bg(100,100,100); |
|
|
|
sf::Color default_bg(100,100,100); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this sets the Truecolor so need to do it first
|
|
|
|
ANSIParser parser(default_fg, default_bg); |
|
|
|
ANSIParser parser(default_fg, default_bg); |
|
|
|
|
|
|
|
std::string colors = generate_colors(); |
|
|
|
|
|
|
|
std::cout << colors; |
|
|
|
|
|
|
|
|
|
|
|
REQUIRE(ftxui::Terminal::ColorSupport() == Terminal::Color::TrueColor); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool good = parser.parse(colors, [&](sf::Color bgcolor, sf::Color color, wchar_t ch) { |
|
|
|
bool good = parser.parse(colors, [&](sf::Color bgcolor, sf::Color color, wchar_t ch) { |
|
|
|
bool correct_char = ch == '#' || ch == ' ' || ch == '\n' || ch == '\r'; |
|
|
|
bool correct_char = ch == '#' || ch == ' ' || ch == '\n' || ch == '\r'; |
|
|
|