void setup() {
size(400, 400);
background(255);
smooth();
noStroke();
colorMode(HSB, 360, 100, 100);
frameRate(2);
}
void draw() {
grassBlade( int(random(width)), int(random(30, 160)), int(random(30, 100)), int(random(30, 100)), int(random(-100, 100)), int(random(50)), int(random(height)) );
}
void grassBlade(int positionx, int bladeColorH, int bladeColorS, int bladeColorB, int bend, int thickness, int bladeHeight) {
fill(bladeColorH, bladeColorS, bladeColorB);
beginShape();
vertex(positionx, height);
bezierVertex(positionx, height - (bladeHeight/2), positionx + bend/3, height - (3*bladeHeight/4), positionx + bend, height - bladeHeight);
bezierVertex(positionx + thickness + .3*bend, height - (3*bladeHeight/4), positionx + thickness, height - (bladeHeight/2), positionx + thickness, height);
endShape();
}