0.1.0Represents a color and allows for calculations within the chosen color space.
(any)
{number} First component: Hue (0-360) or Red (0-255)
(any)
{number} Second component: Saturation (0-100) or Green (0-255)
(any)
{number} Third component: Luminosity (0-100) or Blue (0-255)
(any
= 1)
{number} Alpha component (0-1), default = 100.
(any
= null)
{string} Color.RGB or Color.HSL
HSL mode for Color *
RGB mode for Color *
Create HSL(A) color.
(any)
(any)
(any)
(any
= 1)
Create RGB(A) color.
(any)
(any)
(any)
(any
= 1)
Black
White
Transparent
Converts color to HTML/SVG compatible output.
Predefined palettes.
The PICO-8 palette.
Palette Source: https://pico-8.fandom.com/wiki/Palette
A drawable circle.
Extends Drawable
(any)
(any)
(any)
Obtain point around perimiter, starting at 3 o'clock and proceeding clockwise.
(number)
Number between [0, 1] indicating how far around
perimiter to select. (0 is 3 o'clock, winds clockwise)
(any)
(Lerp)
behavior if outside of [0, 1] interval.
Point:
point along perimiter
An Arc
Extends Drawable
(any)
(any)
(any)
(any)
(any)
(any)
Drawable representing a quadratic bezier path.
Extends Drawable
(any)
(any)
(any)
(any)
(any)
(any)
Drawable representing a cubic bezier path.
Extends Drawable
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
A drawable ellipse.
Extends Drawable
(any)
(any)
(any)
(any)
Obtain point around perimiter, starting at 3 o'clock and proceeding clockwise.
param {number} t Number in [0, 1] interval indicating how far to wind around perimiter.
(any)
(any)
(Lerp)
behavior if outside of [0, 1] interval.
Point:
point along perimiter
Base class for drawables.
Provides
Create copy of object, child object will get a new ID but preserve all other properties.
Set internal ID for object, used to avoid duplication in SVG animation.
(any)
Bind data to object, replaces previously bound data.
(any)
Add a rotation to this drawable, in radians.
(any)
{number} Angle in radians.
Add a rotation to this drawable, in degrees.
(any)
{number} Angle in degrees.
Selection of N evenly spaced points along edge.
(any)
Selection of N random points along edge.
(any)
Draws this item using the global state.
(any)
{Pen} Style to draw with.
(any)
Adjust the item each frame.
Takes animFunc(t, item, context), which should call draw on an item mutated according to these parameters.
(any)
(any)
(any)
A selection of drawables that can be operated upon.
Extends Drawable
(any
= null)
Call a function on each item. callback receives (drawable, context), where context = {"idx": i}
(any)
{function} Callback function, takes (drawable, context)
Call a function on each item, returning results. callback receives (drawable, context), where context = {"idx": i}
(any)
{function} Callback function, takes (drawable, context)
Filter returns the subset of the current selection for which predicate(drawable, context) is true.
(any)
{function} Predicate function, takes (drawable, context)
Draw all elements in a selction together, with the same Pen.
(TODO: asGroup to wrap in a g)
(any)
Add animations for all elements.
(any)
Gather all Drawables in selection into an Array.
Rectangular grid layout.
Divides a box into equally spaced rectangles.
(any)
{number} Number of rows in grid.
(any)
{number} Number of columns in grid.
(any
= null)
{Box} Box to subdivide, if not provided will use the world box.
Height of a single box in the grid.
Width of a single box in the grid.
Get a child Box at a given position
(any)
(any)
Select a vertical line in the grid where line 0 is the left side of
the bounding box and line grid.cols is the right.
(any)
Select a horizontal line in the grid where line 0 is the top side of
the bounding box and line grid.rows is the bottom.
.
(any)
A Selection of all boxes within the grid.
Yields all lines, horizontal, then vertical.
Hexagonal grid layout.
(any)
(any)
(any)
(any)
Defines a radial layout with concentric circles, similar to a sunflower.
(any)
(any)
(any)
(any)
(any)
Static namespace for random helper functions.
Generate a bool which will be true odds percent of the time.
(any
= 0.5)
{number} Proportion of the time the function should return
true
.
Generate a float in interval [0, num)
(any)
Maximum number.
Generate a float in interval [lo, hi).
(any)
{number} Low end of bounds.
(any)
{number} High end of bounds.
Generate an int in interval [lo, hi).
(any)
{number} Low end of bounds.
(any)
{number} High end of bounds.
Generate a random number of radians: [0, 2*PI])
A single x,y point in Cartesian coordinates.
This value is interpreted relative to the world box.
Extends Drawable
(any)
(any)
Represents a line connecting two points.
Extends Drawable
(any)
(any)
(any)
(any)
Return middle point of the line.
Same as lerp(0.5)
Return a copy of the shape moved by (dx, dy).
(any)
{number} Amount to modify x.
(any)
{number} Amount to modify y.
Get a point on the line, interpolated by a value t between 0 and 1.
(any)
(any)
Get starting point of line.
Get end point of line.
A box (rectangle).
All boxes are nested within a parent box with coordinates interpreted relative to that parent.
If no parent is specified, the "world box" is used, a box created when the library is initialized matching the worldBox
Extends Drawable
(any)
(any)
(any)
(any)
(any
= null)
Return a copy of the shape moved by (dx, dy).
(any)
{number} Amount to modify x.
(any)
{number} Amount to modify y.
Get a point along the edge of the box.
(any)
Pick a point around edge of box.
Treats top-left corner as 0, winding around clockwise, so top-right is 0.25, bottom-right 0.5, and bottom-left 0.75 if proportions are equal. If box is not a square, dimensions would be stretched accordingly.
(any)
(any)
Get a line between two points on the box.
Can be used to get an edge, or interior line.
(any)
(any)
A Polygon represented as a set of points to be connected in a clockwise manner.
Extends Drawable
(any)
Return a copy of the shape moved by (dx, dy).
(any)
{number} Amount to modify x.
(any)
{number} Amount to modify y.
Base instance of a honeycomb drawing/animation.
Can be instantiated once to use global methods, or multiple times to have separate isolated rendering contexts.
(any)
(any)
(any)