‹ Back to all posts

Pico Documentation

Required elements

In your code, you must define a function

color: (x, y, f, mx, my, md) => [r, g, b]

where:

Adjusting settings

There are three pre-defined global variables that can be adjusted to modify various properties of the sketch. Their names, default values, and uses are given in the table below.

name default purpose
width 800 sets the width of the sketch, in pixels
height 800 sets the height of the sketch, in pixels
loop true whether or not the sketch should be rendered repeatedly

Other predefined functions

You have access to all JavaScript syntax and facilities (e.g. Array, Set, BigInt, objects, classes, lambda functions) except for the Math library. In place of the Math library, you are provided with the below functions, called in the same way as their builtin Math counterparts. (They are in the global namespace, e.g. just write sin(x) instead of Math.sin(x).)


About | Blog | Projects | Links
© 2024 Brandon Gong.  RSS feed.