fill(r, g, b, [a]);
Set the fill color for shapes
Arguments
r
The red byteg
The green byteb
The blue byte[a]
The alpha byteCan also accept a hexadecimal or color name as string
fill(255, 150, 40);
square(200, 200, 64);
strokeWeight(weight);
No description
Arguments
weight
The line width in pixelstrokeWeight(8);
ine(200, 200, mouseX, mouseY);
stroke(r, g, b, a);
Set the stroke color for shapes
Arguments
r
The red byteg
The green byteb
The blue bytea
The alpha byteOnly implemented for line
and circle
textSize(size);
Set the font size
Arguments
size
The size of the font in pixelsIf this is called using fonts, make sure to call textSize
after calling textFont
textFont(font);
Set the font family
Arguments
font
The font value returned when using loadFontfunction setup()
createWindow(600, 600);
myfont = loadFont('path/to/myfont.ttf');
end
function draw()
background(51);
textFont(myfont);
text('Hello world!', 100, 200);
end