1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-07-03 10:33:26 +00:00

all color names are now accepted in parsecolor

This commit is contained in:
Zeno Rogue 2024-05-27 13:09:10 +02:00
parent bb6df35bf2
commit e5e89c4800

View File

@ -577,8 +577,10 @@ color_t exp_parser::parsecolor(int prio) {
}
string token = next_token();
if(params.count(token)) return (color_t) real(params[token]->get_cld());
if(token == "black") return 0x000000FF;
if(token == "white") return 0xFFFFFFFF;
auto p = find_color_by_name(s);
if(p) return (p->second << 8) | 0xFF;
color_t res;
if(s.size() == 6) {
int qty = sscanf(s.c_str(), "%x", &res);