def setup
background(220)
img = createImage(66, 66)
img.loadPixels
(0...img.width).each do |i|
(0...img.height).each do |j|
img.set(i, j, color(0, 90, 102))
end
end
img.updatePixels
image(img, 17, 17)
end
def setup
background(220)
img = createImage(66, 66)
img.loadPixels
(0...img.width).each do |i|
(0...img.height).each do |j|
img.set(i, j, color(0, 90, 102, (i % img.width) * 2))
end
end
img.updatePixels
image(img, 17, 17)
image(img, 34, 34)
end
def setup
background(220)
pink = color(255, 102, 204)
img = createImage(66, 66)
img.loadPixels
d = pixelDensity
halfImage = 4 * (img.width * d) * (img.height / 2 * d)
0.step(halfImage, 4) do |i|
img.pixels[i] = red(pink)
img.pixels[i + 1] = green(pink)
img.pixels[i + 2] = blue(pink)
img.pixels[i + 3] = alpha(pink)
end
img.updatePixels
image(img, 17, 17)
end