1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-23 09:57:41 +00:00

pattern formula:: wallif function

This commit is contained in:
Zeno Rogue
2019-11-15 13:37:41 +01:00
parent be5dc871b6
commit 388ac890bf
2 changed files with 10 additions and 2 deletions

View File

@@ -1661,9 +1661,10 @@ EX namespace patterns {
}
case 'f': {
color_t res;
for(int i=0; i<3; i++) {
for(int i=0; i<4; i++) {
ld v = real(compute_map_function(c, 1+i, color_formula));
if(v < 0) part(res, i) = 0;
if(i == 3) part(res, i) = (v > 0);
else if(v < 0) part(res, i) = 0;
else if(v > 1) part(res, i) = 255;
else part(res, i) = int(v * 255 + .5);
}