46 if (str ==
"true_color") {
49 if (str ==
"greyscale") {
54 std::string lower_str = str;
55 std::ranges::transform(
56 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
59 if (lower_str ==
"true-color") {
62 if (lower_str ==
"true_color") {
65 if (lower_str ==
"truecolor") {
68 if (lower_str ==
"color") {
72 if (lower_str ==
"greyscale") {
75 if (lower_str ==
"grayscale") {
78 if (lower_str ==
"grey") {
81 if (lower_str ==
"gray") {
104 panic(
"unhandled TilesPaletteMode value");
121 constexpr auto parse(std::format_parse_context &ctx)
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
TilesPaletteMode
Controls how tiles.png is rendered.
@ greyscale
Render tiles in greyscale (useful for debugging).
@ true_color
Render tiles with true colors from the palette.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.
std::optional< TilesPaletteMode > tiles_palette_mode_from_str(const std::string &str)
Parses a string into a TilesPaletteMode with fuzzy matching.