|
fill() - Version: 209
|
||||||
|
Description
or
Parameters gray – number specifying value between white and black value1 – red value value2 – green value value3 – blue value Returns none Related noFill() stroke() background() Example void setup() { background(0,0,0);// set the screen black } void loop() { fill(255,0,0);// fill the next shape with Red rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(0,255,0);// fill the next shape with Green rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(0,0,255);// fill the next shape with Blue rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(255);// fill the next shape with White rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(255,255,255);// fill the next shape with White rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(200);// fill the next shape with gray rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(200,200,200);// fill the next shape with gray rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(150);// fill the next shape with gray rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(150,150,150);// fill the next shape with gray rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(100);// fill the next shape with gray rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second fill(100,100,100);// fill the next shape with gray rect(40,40,40,40); //draw a rectangle at point (40,40), width = 40, height = 40 delay(1000); //delay 1 second } Note fill(98, 98, 98) is the same as fill(98)
|
||||||


