Tuesday, 28 June 2016

Geen To Yellow Diagnol Code

   













image = new SimpleImage(200,200);
w = image.getWidth();
for (var p of image.values()) {
    p.setGreen(255);
    p.setRed(0);
    p.setBlue(0);
}
print(image);
for (var p of image.values()) {
     x = p.getX();
     y = p.getY();
     if (x + y < w) {
          p.setRed(255);
     }
}
print(image);


No comments:

Post a Comment