1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-03-21 04:19:43 +00:00

new color pattern: formula

This commit is contained in:
Zeno Rogue
2019-01-28 21:43:13 +01:00
parent b751fa56c6
commit 34d4223bed
2 changed files with 80 additions and 0 deletions

View File

@@ -176,6 +176,19 @@ cld exp_parser::parse(int prio) {
cld no = parsepar();
return real(cond) > 0 ? yes : no;
}
else if(eat("rgb(")) {
cld val0 = parse(0);
if(next() != ',') {at = -1; return 0; } at++;
cld val1 = parse(0);
if(next() != ',') {at = -1; return 0; } at++;
cld val2 = parsepar();
switch(int(real(extra_params["p"]) + .5)) {
case 1: return val0;
case 2: return val1;
case 3: return val2;
default: return 0;
}
}
else if(eat("let(")) {
string name;
while(true) {