3#include <unordered_map>
9static const std::unordered_map<std::string, std::string_view>
kNameTable = {
29std::string
Strip(std::string_view text)
32 out.reserve(text.size());
35 if (
static_cast<unsigned char>(c) > 0x10)
43std::vector<Labeled<std::string>>
PaletteChoices(std::function<std::string(std::string_view canonicalName)> labelFor)
45 std::vector<Labeled<std::string>> choices;
46 choices.reserve(
Palette.size());
48 for (
const auto& entry :
Palette)
50 std::string label = labelFor ? labelFor(entry.Name) : std::string{};
53 label = std::string(entry.Name);
55 choices.push_back({.Label = std::move(label), .Value = std::string(entry.Name)});
static std::string ToLower(std::string_view str)
constexpr std::string_view Orange
constexpr std::string_view Blue
constexpr std::string_view DarkRed
std::string_view ParseNamed(std::string_view name)
constexpr std::string_view Magenta
constexpr std::string_view Olive
constexpr std::string_view Gray
std::vector< Labeled< std::string > > PaletteChoices(std::function< std::string(std::string_view canonicalName)> labelFor)
constexpr std::string_view Silver
constexpr std::string_view White
constexpr std::string_view Default
constexpr std::string_view Yellow
constexpr std::string_view LightYellow
constexpr std::string_view Green
constexpr std::string_view LightRed
constexpr std::string_view DarkBlue
constexpr std::string_view Red
constexpr std::string_view Gold
constexpr std::array< NamedColor, 15 > Palette
constexpr std::string_view LightBlue
constexpr std::string_view Grey
std::string Strip(std::string_view text)
static const std::unordered_map< std::string, std::string_view > kNameTable
constexpr std::string_view Lime
constexpr std::string_view LightPurple
constexpr std::string_view BlueGrey
constexpr std::string_view Purple