June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,30 @@
require('GD')
func pinstripes(width = 1280, height = 720) {
var im = %O<GD::Image>.new(width, height)
var colors = [0, 255].variations_with_repetition(3)
var paintcolors = colors.shuffle.map {|rgb|
im.colorAllocate(rgb...)
}
var starty = 0
var barheight = height//4
for barwidth in (1..4) {
for (
var(startx = 0, colorindex = 0);
startx + barwidth <= width;
startx += barwidth
) {
im.filledRectangle(startx, starty, startx+barwidth,
starty + barheight - 1, paintcolors[colorindex++ % 8])
}
starty += barheight
}
return im
}
File('pinstripes.png').write(pinstripes().png, :raw)