Skip to content
You are viewing documentation for v3.0.0. Switch to latest (main).

Module ftxui/screen ​

Classes & Structs ​

ClassDescription
ftxui::Box
ftxui::ColorA class representing terminal colors.
ftxui::ColorInfo
ftxui::Dimensions
ftxui::PixelA unicode character and its associated style.
ftxui::ScreenA rectangular grid of Pixel.
ftxui::Screen::Cursor

Enumerations ​

Color ​

cpp
enum Color { Palette1, Palette16, Palette256, TrueColor };

Examples: component/button_animated, component/button_in_frame, component/button_style, component/canvas_animated, component/flexbox_gallery, component/focus, component/homescreen, component/maybe, component/menu_entries, component/menu_entries_animated, component/menu_style, component/menu_underline_animated_gallery (+14 more)

Functions ​

SymbolDescription
ContainReturns: whether (x,y) is contained inside the box.
IntersectionReturns: the biggest Box contained in both a and b.
operator!=Returns: whether other and this are different.
operator==Returns: whether other is the same as this
ColorBuild a transparent color.
HSVBuild a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
RGBBuild a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
operator""_rgbCreates a color from a combined hex RGB representation, e.g. 0x808000_rgb.
SetFallbackSizeOverride terminal size in case auto-detection fails.
to_stringConvert a UTF8 std::string into a std::wstring.
to_wstringConvert a std::wstring into a UTF8 std::string.

Contain ​

cpp
bool Contain(int x, int y) const;

Returns: whether (x,y) is contained inside the box.

Intersection ​

cpp
static Box Intersection(Box a, Box b);

Returns: the biggest Box contained in both a and b.

operator!= ​

cpp
bool operator!=(const Box & other) const;

Returns: whether other and this are different.

operator== ​

cpp
bool operator==(const Box & other) const;

Returns: whether other is the same as this

Color ​

cpp
Color();

Build a transparent color.

Examples: component/button_animated, component/button_in_frame, component/button_style, component/canvas_animated, component/flexbox_gallery, component/focus, component/homescreen, component/maybe, component/menu_entries, component/menu_entries_animated, component/menu_style, component/menu_underline_animated_gallery (+14 more)

Color ​

cpp
Color(Palette1 index);

Build a transparent color.

Examples: component/button_animated, component/button_in_frame, component/button_style, component/canvas_animated, component/flexbox_gallery, component/focus, component/homescreen, component/maybe, component/menu_entries, component/menu_entries_animated, component/menu_style, component/menu_underline_animated_gallery (+14 more)

Color ​

cpp
Color(Palette16 index);

Build a transparent using Palette16 colors.

Examples: component/button_animated, component/button_in_frame, component/button_style, component/canvas_animated, component/flexbox_gallery, component/focus, component/homescreen, component/maybe, component/menu_entries, component/menu_entries_animated, component/menu_style, component/menu_underline_animated_gallery (+14 more)

Color ​

cpp
Color(Palette256 index);

Build a transparent using Palette256 colors.

Examples: component/button_animated, component/button_in_frame, component/button_style, component/canvas_animated, component/flexbox_gallery, component/focus, component/homescreen, component/maybe, component/menu_entries, component/menu_entries_animated, component/menu_style, component/menu_underline_animated_gallery (+14 more)

Color ​

cpp
Color(uint8_t red, uint8_t green, uint8_t blue);

Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.

Parameters:

  • red: The quantity of red [0,255]
  • green: The quantity of green [0,255]
  • blue: The quantity of blue [0,255]

Examples: component/button_animated, component/button_in_frame, component/button_style, component/canvas_animated, component/flexbox_gallery, component/focus, component/homescreen, component/maybe, component/menu_entries, component/menu_entries_animated, component/menu_style, component/menu_underline_animated_gallery (+14 more)

HSV ​

cpp
static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value);

Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.

Parameters:

  • h: The hue of the color [0,255]
  • s: The "colorfulness" [0,255].
  • v: The "Lightness" [0,255]

Examples: component/flexbox_gallery, component/focus, component/homescreen, dom/color_gallery, dom/color_truecolor_HSV

RGB ​

cpp
static Color RGB(uint8_t red, uint8_t green, uint8_t blue);

Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.

Parameters:

  • red: The quantity of red [0,255]
  • green: The quantity of green [0,255]
  • blue: The quantity of blue [0,255]

Examples: component/slider_rgb, dom/color_truecolor_RGB

operator""_rgb ​

cpp
Color operator""_rgb(unsigned long long int combined);

Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb.

SetFallbackSize ​

cpp
void SetFallbackSize(const Dimensions & fallbackSize);

Override terminal size in case auto-detection fails.

Parameters:

  • fallbackSize: Terminal dimensions to fallback to

to_string ​

cpp
std::string to_string(const std::wstring & s);

Convert a UTF8 std::string into a std::wstring.

Examples: component/button, component/button_animated, component/button_in_frame, component/button_style, component/checkbox, component/checkbox_in_frame, component/composition, component/flexbox_gallery, component/focus, component/homescreen, component/menu2, component/menu_entries (+14 more)

to_wstring ​

cpp
std::wstring to_wstring(const std::string & s);

Convert a std::wstring into a UTF8 std::string.