56 if (str ==
"true_color") {
59 if (str ==
"greyscale") {
64 std::string lower_str = str;
65 std::ranges::transform(
66 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
69 if (lower_str ==
"true-color") {
72 if (lower_str ==
"true_color") {
75 if (lower_str ==
"truecolor") {
78 if (lower_str ==
"color") {
82 if (lower_str ==
"greyscale") {
85 if (lower_str ==
"grayscale") {
88 if (lower_str ==
"grey") {
91 if (lower_str ==
"gray") {
116 panic(
"unhandled TilesPalMode value");
135 constexpr auto parse(std::format_parse_context &ctx)
std::optional< TilesPalMode > tiles_pal_mode_from_str(const std::string &str)
Parses a string into a TilesPalMode with fuzzy matching.
TilesPalMode
Controls how tiles.png is rendered.
@ greyscale
Render tiles in greyscale (useful for debugging).
@ true_color
Render tiles with true colors from the palette.
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.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.