Tuesday, 28 June 2016

Black To Blue Bottom Right

image = new SimpleImage(200,200);
for (var p of image.values()){
    p.setRed(0);
    p.setBlue(0);
    p.setGreen(0);
}
w = image.getWidth();
h = image.getHeight();
for (var p of image.values()) {
     x = p.getX();
     y = p.getY();
     if (x > w/2 && y > h/2) {
          p.setBlue(255);
     }
}
print (image);


No comments:

Post a Comment