mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-12 10:20:32 +00:00
all color names are now accepted in parsecolor
This commit is contained in:
parent
bb6df35bf2
commit
e5e89c4800
6
util.cpp
6
util.cpp
@ -577,8 +577,10 @@ color_t exp_parser::parsecolor(int prio) {
|
|||||||
}
|
}
|
||||||
string token = next_token();
|
string token = next_token();
|
||||||
if(params.count(token)) return (color_t) real(params[token]->get_cld());
|
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;
|
color_t res;
|
||||||
if(s.size() == 6) {
|
if(s.size() == 6) {
|
||||||
int qty = sscanf(s.c_str(), "%x", &res);
|
int qty = sscanf(s.c_str(), "%x", &res);
|
||||||
|
Loading…
Reference in New Issue
Block a user