mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-29 16:39:34 +08:00
Add support for full RGB colors.
FTXUI supported only the 16 colors palette. This patch adds support for the 256 palette and the TrueColor(8×8×8) mode. This was made by kerdelos@ and fixes issue: https://github.com/ArthurSonzogni/FTXUI/issues/45 Co-authored-by: Damien D <kerdelos@gmail.com> Co-authored-by: Arthur Sonzogni <sonzogniarthur@gmail.com>
This commit is contained in:

committed by
Arthur Sonzogni

parent
49941b6403
commit
dc8c090753
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMINMAX
|
||||
@@ -33,6 +35,11 @@ Terminal::Dimensions Terminal::Size() {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Terminal::CanSupportTrueColors() {
|
||||
std::string COLORTERM = std::getenv("COLORTERM");
|
||||
return COLORTERM.compare("24bit") || COLORTERM.compare("trueColor");
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
||||
|
||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||
|
Reference in New Issue
Block a user