twrabetz-05-wallpaper

sketch

function setup() 
{
    createCanvas(480,480);
    background(50);
 
    var col;
    var size;

    for( var i = 0; i < 4; i++ )
    {
        for( var j = 0; j < 4; j++ )
        {
            col = color( random(25,75), random(25,75), random(25,75) );
            size = random( 18, 28 );
            drawSpiral( 55 + i * (width - 130) / 3, 70 + j * (height - 130) / 3,
                        0, size, col );
        }
    }

    noLoop();
}

function drawSpiral( xPos, yPos, angle, size, col )
{
    if( size < 7.5 ) return;

    push();
    translate( xPos, yPos );
    rotate( radians(angle - 90) );
    fill( col );
    rect( size * 4 / 3, 0, size, size );
    pop();
    drawSpiral( xPos, yPos, angle + 30, size * 0.935, 
                color( red(col) + 7.5, green(col) + 7.5, blue(col) + 7.5 ) );
}

The prompt asked for “a balance of geometric and organic forms” aka a clear request for shrimps made out of squares.
Note that the shrimps do not merely scale in size, but also have curly tails based on their size as should be expected of any quality shrimps.

Leave a Reply