All Functions
Quick reference for all Bloom functions.
Drawing Shapes
circle(x, y, radius)- Draw circleellipse(x, y, w, h)- Draw ellipserect(x, y, w, h)- Draw rectanglerect(x, y, w, h, r)- Rounded rectangleline(x1, y1, x2, y2)- Draw linetriangle(x1, y1, x2, y2, x3, y3)- Draw trianglepoint(x, y)- Draw single pointarc(x, y, w, h, start, stop)- Draw arc
Colors
fill(color)- Set fill colorstroke(color)- Set stroke colornoFill()- Disable fillnoStroke()- Disable strokestrokeWeight(n)- Set line thicknessbackground(color)- Fill canvas with colorrgb(r, g, b)- Create color from RGBrgba(r, g, b, a)- RGB with transparencyhsl(h, s, l)- Create color from HSLhsla(h, s, l, a)- HSL with transparency
Text
text(str, x, y)- Draw texttextSize(n)- Set font sizetextFont(name)- Set fonttextAlign(align)- "left", "center", "right"
Math
abs(n)- Absolute valueround(n)- Round to nearest integerfloor(n),ceil(n)- Round down/upmin(a, b),max(a, b)- Smaller/larger valueclamp(v, min, max)- Constrain to rangesqrt(n)- Square rootpow(base, exp)- Powersin(angle),cos(angle),tan(angle)- Trig (radians)atan2(y, x)- Angle from coordinatesradians(deg),degrees(rad)- Convert angles
Utilities
random(min, max)- Random numbernoise(x, y?, z?)- Perlin noise (0-1)map(v, a1, b1, a2, b2)- Map rangelerp(a, b, t)- Linear interpolationdist(x1, y1, x2, y2)- Distance between pointsprint(value)- Print to console
Arrays
len(array)- Array lengthpush(array, item)- Add to endpop(array)- Remove from endrange(start, end, step?)- Create number sequence
Canvas
size(w, h)- Set canvas sizewidth- Canvas widthheight- Canvas heightframe- Current frame number
Input
mouseX,mouseY- Mouse positionmousePressed- Is mouse button heldkeyPressed- Is any key heldkey- Current key name
Transforms
translate(x, y)- Move originrotate(angle)- Rotate (radians)scale(x, y?)- Scale drawingpush()- Save transform statepop()- Restore transform state
Named Colors
red, orange, yellow, green, blue, purple, pink, coral, cyan, magenta, white, black, gray, brown, navy, teal, olive, maroon, lime, aqua, silver, gold