examples/dom/color_truecolor_RGB.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<ftxui/dom/elements.hpp>//forhbox,text,bgcolor,operator|,vbox,Elements,window,Element,Fit
    #include<ftxui/screen/screen.hpp>//forFull,Screen
    #include<memory>//forallocator
    #include<utility>//formove

    #include"ftxui/dom/node.hpp"//forRender
    #include"ftxui/screen/color.hpp"//forColor,ftxui

    intmain(){
    usingnamespaceftxui;

    Elementsred_line;
    Elementsgreen_line;
    Elementsblue_line;
    Elementscyan_line;
    Elementsmagenta_line;
    Elementsyellow_line;

    for(intvalue=0;value<255;value+=3){
    intv=value*value/255;
    red_line.push_back(text("")|bgcolor(Color::RGB(v,0,0)));
    green_line.push_back(text("")|bgcolor(Color::RGB(0,v,0)));
    blue_line.push_back(text("")|bgcolor(Color::RGB(0,0,v)));
    cyan_line.push_back(text("")|bgcolor(Color::RGB(0,v,v)));
    magenta_line.push_back(text("")|bgcolor(Color::RGB(v,0,v)));
    yellow_line.push_back(text("")|bgcolor(Color::RGB(v,v,0)));
    }

    autodocument=vbox({
    window(text("Primarycolors"),
    vbox({
    hbox({text("Redline:"),hbox(std::move(red_line))}),
    hbox({text("Greenline:"),hbox(std::move(green_line))}),
    hbox({text("Blueline:"),hbox(std::move(blue_line))}),
    })),
    window(text("Secondarycolors"),
    vbox({
    hbox({text("cyanline:"),hbox(std::move(cyan_line))}),
    hbox({text("magentaline:"),hbox(std::move(magenta_line))}),
    hbox({text("Yellowline:"),hbox(std::move(yellow_line))}),
    })),
    });

    autoscreen=Screen::Create(Dimension::Full(),Dimension::Fit(document));
    Render(screen,document);

    screen.Print();

    return0;
    }