A collection of helper methods are available.
Creates Canvas2D compatible RGB strings from an Array of length 3
rgbToString([64, 224, 208]); // returns "rgb(64,244,208)"
Creates Canvas2D compatible RGBA strings from an Array of length 4
rgbaToString([64, 224, 208, 255]); // returns "rgba(64,244,208,1)"
modV includes p5.Math.js which is a collection of math methods from Processing added onto the Math object.
- Math.sq()
- Math.constrain()
- Math.degrees()
- Math.mag()
- Math.dist()
- Math.lerp()
- Math.norm()
- Math.map()
Find out more about p5.Math.js here which includes links to the docs per function.