Minor fixes to make initializing the terminal more consistent and to remove a magic number for wall limits.
This commit is contained in:
parent
2d5490131d
commit
ae43dad499
12 changed files with 47 additions and 42 deletions
|
@ -10,12 +10,16 @@
|
|||
#include "ftxui/screen/color.hpp" // for Color, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::White, Color::Yellow, Color::YellowLight, Color::Palette256, ftxui
|
||||
#include <ftxui/screen/color_info.hpp> // for ColorInfo
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <ftxui/screen/terminal.hpp> // for ColorSupport, Color, Palette16, Palette256, TrueColor
|
||||
#include "render.hpp"
|
||||
|
||||
using namespace fmt;
|
||||
using namespace ftxui;
|
||||
|
||||
std::string generate_colors() {
|
||||
SFMLRender::init_terminal();
|
||||
|
||||
REQUIRE(ftxui::Terminal::ColorSupport() == ftxui::Terminal::Color::TrueColor);
|
||||
|
||||
const int max_value = 255;
|
||||
|
@ -30,8 +34,8 @@ std::string generate_colors() {
|
|||
for (int hue = 0; hue < max_value; hue += hue_increment) {
|
||||
line.push_back(
|
||||
text("#") //
|
||||
| color(Color::HSV(hue, saturation, value)) //
|
||||
| bgcolor(Color::HSV(hue, saturation, value + value_increment)));
|
||||
| ftxui::color(Color::HSV(hue, saturation, value)) //
|
||||
| ftxui::bgcolor(Color::HSV(hue, saturation, value + value_increment)));
|
||||
count++;
|
||||
}
|
||||
array.push_back(hbox(std::move(line)));
|
||||
|
@ -51,6 +55,7 @@ std::string generate_colors() {
|
|||
}
|
||||
|
||||
TEST_CASE("test out ragel parser", "[gui]") {
|
||||
SFMLRender::init_terminal();
|
||||
sf::Color default_fg(0,0,0);
|
||||
sf::Color default_bg(100,100,100);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue