examples/dom/color_info_palette256.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<ftxui/dom/elements.hpp>//fortext,bgcolor,hbox,operator|,Elements,Fit,vbox,Element
    #include<ftxui/screen/color_info.hpp>//forColorInfo
    #include<ftxui/screen/screen.hpp>//forFull,Screen
    #include<utility>//formove
    #include<vector>//forvector,allocator

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

    usingnamespaceftxui;
    #include"./color_info_sorted_2d.ipp"//forColorInfoSorted2D

    intmain(){
    std::vector<std::vector<ColorInfo>>info_columns=ColorInfoSorted2D();

    //Draweverycolumns
    Elementscolumns_elements;
    for(auto&column:info_columns){
    Elementscolumn_elements;
    for(auto&it:column){
    column_elements.push_back(hbox({
    text("")|bgcolor(Color(Color::Palette256(it.index_256))),
    text(it.name),
    }));
    }
    columns_elements.push_back(vbox(std::move(column_elements)));
    }
    autodocument=hbox(std::move(columns_elements));

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

    screen.Print();

    return0;
    }