diff options
Diffstat (limited to 'javascript_network/p5.min.js')
| -rw-r--r-- | javascript_network/p5.min.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/javascript_network/p5.min.js b/javascript_network/p5.min.js new file mode 100644 index 0000000..899b232 --- /dev/null +++ b/javascript_network/p5.min.js @@ -0,0 +1,36 @@ +/*! p5.js v0.5.14 August 28, 2017 */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.p5=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){b.exports={project:{name:"p5",description:"[](https://travis-ci.org/processing/p5.js) [](https://www.npmjs.com/package/p5)",version:"0.5.14",url:"https://github.com/processing/p5.js#readme"},files:{"src/color/color_conversion.js":{name:"src/color/color_conversion.js",modules:{"Color Conversion":1},classes:{},fors:{p5:1},namespaces:{}},"src/color/creating_reading.js":{name:"src/color/creating_reading.js",modules:{"Creating & Reading":1},classes:{},fors:{p5:1},namespaces:{}},"src/color/p5.Color.js":{name:"src/color/p5.Color.js",modules:{},classes:{"p5.Color":1},fors:{p5:1},namespaces:{}},"src/color/setting.js":{name:"src/color/setting.js",modules:{Setting:1},classes:{},fors:{p5:1},namespaces:{}},"src/core/2d_primitives.js":{name:"src/core/2d_primitives.js",modules:{"2D Primitives":1},classes:{},fors:{p5:1},namespaces:{}},"src/core/attributes.js":{name:"src/core/attributes.js",modules:{Attributes:1},classes:{},fors:{p5:1},namespaces:{}},"src/core/canvas.js":{name:"src/core/canvas.js",modules:{},classes:{},fors:{},namespaces:{}},"src/core/constants.js":{name:"src/core/constants.js",modules:{Constants:1},classes:{},fors:{p5:1},namespaces:{}},"src/core/core.js":{name:"src/core/core.js",modules:{Structure:1},classes:{},fors:{p5:1},namespaces:{}},"src/core/curves.js":{name:"src/core/curves.js",modules:{Curves:1},classes:{},fors:{p5:1},namespaces:{}},"src/core/environment.js":{name:"src/core/environment.js",modules:{Environment:1},classes:{},fors:{p5:1},namespaces:{}},"src/core/error_helpers.js":{name:"src/core/error_helpers.js",modules:{},classes:{},fors:{p5:1},namespaces:{}},"src/core/init.js":{name:"src/core/init.js",modules:{},classes:{},fors:{},namespaces:{}},"src/core/p5.Element.js":{name:"src/core/p5.Element.js",modules:{DOM:1},classes:{"p5.Element":1},fors:{"p5.Element":1},namespaces:{}},"src/core/p5.Graphics.js":{name:"src/core/p5.Graphics.js",modules:{Rendering:1},classes:{"p5.Graphics":1},fors:{p5:1},namespaces:{}},"src/core/p5.Renderer.js":{name:"src/core/p5.Renderer.js",modules:{},classes:{"p5.Renderer":1},fors:{p5:1},namespaces:{}},"src/core/p5.Renderer2D.js":{name:"src/core/p5.Renderer2D.js",modules:{},classes:{},fors:{},namespaces:{}},"src/core/rendering.js":{name:"src/core/rendering.js",modules:{},classes:{},fors:{p5:1},namespaces:{}},"src/core/shim.js":{name:"src/core/shim.js",modules:{},classes:{},fors:{},namespaces:{}},"src/core/structure.js":{name:"src/core/structure.js",modules:{},classes:{},fors:{p5:1},namespaces:{}},"src/core/transform.js":{name:"src/core/transform.js",modules:{Transform:1},classes:{},fors:{p5:1},namespaces:{}},"src/core/vertex.js":{name:"src/core/vertex.js",modules:{Vertex:1},classes:{},fors:{p5:1},namespaces:{}},"src/data/p5.TypedDict.js":{name:"src/data/p5.TypedDict.js",modules:{Dictionary:1},classes:{"p5.TypedDict":1,"p5.StringDict":1,"p5.NumberDict":1},fors:{"p5.TypedDict":1},namespaces:{}},"src/events/acceleration.js":{name:"src/events/acceleration.js",modules:{Acceleration:1},classes:{},fors:{p5:1},namespaces:{}},"src/events/keyboard.js":{name:"src/events/keyboard.js",modules:{Keyboard:1},classes:{},fors:{p5:1},namespaces:{}},"src/events/mouse.js":{name:"src/events/mouse.js",modules:{Mouse:1},classes:{},fors:{p5:1},namespaces:{}},"src/events/touch.js":{name:"src/events/touch.js",modules:{Touch:1},classes:{},fors:{p5:1},namespaces:{}},"src/image/filters.js":{name:"src/image/filters.js",modules:{},classes:{},fors:{},namespaces:{}},"src/image/image.js":{name:"src/image/image.js",modules:{Image:1},classes:{},fors:{p5:1},namespaces:{}},"src/image/loading_displaying.js":{name:"src/image/loading_displaying.js",modules:{"Loading & Displaying":1},classes:{},fors:{p5:1},namespaces:{}},"src/image/p5.Image.js":{name:"src/image/p5.Image.js",modules:{},classes:{"p5.Image":1},fors:{},namespaces:{}},"src/image/pixels.js":{name:"src/image/pixels.js",modules:{Pixels:1},classes:{},fors:{p5:1},namespaces:{}},"src/io/files.js":{name:"src/io/files.js",modules:{Input:1,Output:1},classes:{},fors:{p5:1},namespaces:{}},"src/io/p5.Table.js":{name:"src/io/p5.Table.js",modules:{Table:1},classes:{"p5.Table":1},fors:{},namespaces:{}},"src/io/p5.TableRow.js":{name:"src/io/p5.TableRow.js",modules:{},classes:{"p5.TableRow":1},fors:{},namespaces:{}},"src/io/p5.XML.js":{name:"src/io/p5.XML.js",modules:{XML:1},classes:{"p5.XML":1},fors:{},namespaces:{}},"src/math/calculation.js":{name:"src/math/calculation.js",modules:{Calculation:1},classes:{},fors:{p5:1},namespaces:{}},"src/math/math.js":{name:"src/math/math.js",modules:{Math:1},classes:{},fors:{p5:1},namespaces:{}},"src/math/noise.js":{name:"src/math/noise.js",modules:{Noise:1},classes:{},fors:{p5:1},namespaces:{}},"src/math/p5.Vector.js":{name:"src/math/p5.Vector.js",modules:{},classes:{"p5.Vector":1},fors:{},namespaces:{}},"src/math/random.js":{name:"src/math/random.js",modules:{Random:1},classes:{},fors:{p5:1},namespaces:{}},"src/math/trigonometry.js":{name:"src/math/trigonometry.js",modules:{Trigonometry:1},classes:{},fors:{p5:1},namespaces:{}},"src/typography/attributes.js":{name:"src/typography/attributes.js",modules:{},classes:{},fors:{p5:1},namespaces:{}},"src/typography/loading_displaying.js":{name:"src/typography/loading_displaying.js",modules:{},classes:{},fors:{p5:1},namespaces:{}},"src/typography/p5.Font.js":{name:"src/typography/p5.Font.js",modules:{Font:1},classes:{"p5.Font":1},fors:{},namespaces:{}},"src/utilities/array_functions.js":{name:"src/utilities/array_functions.js",modules:{"Array Functions":1},classes:{},fors:{p5:1},namespaces:{}},"src/utilities/conversion.js":{name:"src/utilities/conversion.js",modules:{Conversion:1},classes:{},fors:{p5:1},namespaces:{}},"src/utilities/string_functions.js":{name:"src/utilities/string_functions.js",modules:{"String Functions":1},classes:{},fors:{p5:1},namespaces:{}},"src/utilities/time_date.js":{name:"src/utilities/time_date.js",modules:{"Time & Date":1},classes:{},fors:{p5:1},namespaces:{}},"src/webgl/camera.js":{name:"src/webgl/camera.js",modules:{Camera:1},classes:{},fors:{p5:1},namespaces:{}},"src/webgl/light.js":{name:"src/webgl/light.js",modules:{Lights:1},classes:{},fors:{p5:1},namespaces:{}},"src/webgl/loading.js":{name:"src/webgl/loading.js",modules:{"3D Models":1},classes:{},fors:{p5:1},namespaces:{}},"src/webgl/material.js":{name:"src/webgl/material.js",modules:{Material:1},classes:{},fors:{p5:1},namespaces:{}},"src/webgl/p5.Geometry.js":{name:"src/webgl/p5.Geometry.js",modules:{},classes:{"p5.Geometry":1},fors:{},namespaces:{}},"src/webgl/p5.Matrix.js":{name:"src/webgl/p5.Matrix.js",modules:{},classes:{},fors:{},namespaces:{}},"src/webgl/p5.RendererGL.Immediate.js":{name:"src/webgl/p5.RendererGL.Immediate.js",modules:{},classes:{},fors:{},namespaces:{}},"src/webgl/p5.RendererGL.Retained.js":{name:"src/webgl/p5.RendererGL.Retained.js",modules:{},classes:{},fors:{},namespaces:{}},"src/webgl/p5.RendererGL.js":{name:"src/webgl/p5.RendererGL.js",modules:{},classes:{"p5.RendererGL":1},fors:{},namespaces:{}},"src/webgl/primitives.js":{name:"src/webgl/primitives.js",modules:{"3D Primitives":1},classes:{},fors:{p5:1},namespaces:{}},"lib/addons/p5.dom.js":{name:"lib/addons/p5.dom.js",modules:{"p5.dom":1},classes:{"p5.MediaElement":1,"p5.File":1},fors:{"p5.dom":1,"p5.Element":1},namespaces:{}},"lib/addons/p5.sound.js":{name:"lib/addons/p5.sound.js",modules:{"p5.sound":1},classes:{p5:1,"p5.SoundFile":1,"p5.Amplitude":1,"p5.FFT":1,"p5.Signal":1,"p5.Oscillator":1,"p5.SinOsc":1,"p5.TriOsc":1,"p5.SawOsc":1,"p5.SqrOsc":1,"p5.Env":1,"p5.Pulse":1,"p5.Noise":1,"p5.AudioIn":1,"p5.Effect":1,"p5.Filter":1,"p5.LowPass":1,"p5.HighPass":1,BandPass:1,"p5.Delay":1,"p5.Reverb":1,"p5.Convolver":1,"p5.Phrase":1,"p5.Part":1,"p5.Score":1,"p5.Compressor":1,"p5.SoundRecorder":1,"p5.PeakDetect":1,"p5.Gain":1,"p5.Distortion":1},fors:{"p5.sound":1},namespaces:{}}},modules:{Conversion:{name:"Conversion",submodules:{},elements:{},classes:{},fors:{p5:1},namespaces:{},module:"Data",file:"src/utilities/conversion.js",line:1,requires:["core"]},"Color Conversion":{name:"Color Conversion",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"IO",namespace:"",file:"src/color/color_conversion.js",line:1,requires:["core"]},Color:{name:"Color",submodules:{"Creating & Reading":1,Setting:1},elements:{},classes:{"p5.Color":1},fors:{p5:1},namespaces:{},file:"src/color/p5.Color.js",line:14},"Creating & Reading":{name:"Creating & Reading",submodules:{},elements:{},classes:{"p5.Color":1},fors:{p5:1},is_submodule:1,namespaces:{},module:"Color",namespace:"",file:"src/color/p5.Color.js",line:14,requires:["core","constants"],description:"<p>We define colors to be immutable objects. Each color stores the color mode\nand level maxes that applied at the time of its construction. These are\nused to interpret the input arguments and to format the output e.g. when\nsaturation() is requested.</p>\n<p>Internally we store an array representing the ideal RGBA values in floating\npoint form, normalized from 0 to 1. From this we calculate the closest\nscreen color (RGBA levels from 0 to 255) and expose this to the renderer.</p>\n<p>We also cache normalized, floating point components of the color in various\nrepresentations as they are calculated. This is done to prevent repeating a\nconversion that has already been performed.</p>\n"},Setting:{name:"Setting",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Color",namespace:"",file:"src/color/setting.js",line:1,requires:["core","constants"]},Shape:{name:"Shape",submodules:{"2D Primitives":1,Curves:1,Vertex:1,"3D Models":1,"3D Primitives":1},elements:{},classes:{},fors:{p5:1},namespaces:{}},"2D Primitives":{name:"2D Primitives",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Shape",namespace:"",file:"src/core/2d_primitives.js",line:1,requires:["core","constants"]},Attributes:{name:"Attributes",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Typography",namespace:"",file:"src/core/attributes.js",line:1,requires:["core","constants"]},Constants:{name:"Constants",submodules:{},elements:{},classes:{},fors:{p5:1},namespaces:{},module:"Constants",file:"src/core/constants.js",line:1},Structure:{name:"Structure",submodules:{},elements:{},classes:{},fors:{p5:1},namespaces:{},module:"Structure",file:"src/core/core.js",line:1,requires:["constants"]},Curves:{name:"Curves",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Shape",namespace:"",file:"src/core/curves.js",line:1,requires:["core"]},Environment:{name:"Environment",submodules:{},elements:{},classes:{},fors:{p5:1},namespaces:{},module:"Environment",file:"src/core/environment.js",line:1,requires:["core","constants"]},DOM:{name:"DOM",submodules:{},elements:{},classes:{"p5.Element":1},fors:{"p5.Element":1},namespaces:{},module:"DOM",file:"src/core/p5.Element.js",line:9,description:'<p>Base class for all elements added to a sketch, including canvas,\ngraphics buffers, and other HTML elements. Methods in blue are\nincluded in the core functionality, methods in brown are added\nwith the <a href="http://p5js.org/reference/#/libraries/p5.dom">p5.dom\nlibrary</a>.\nIt is not called directly, but p5.Element\nobjects are created by calling createCanvas, createGraphics,\nor in the p5.dom library, createDiv, createImg, createInput, etc.</p>\n'},Rendering:{name:"Rendering",submodules:{},elements:{},classes:{"p5.Graphics":1,"p5.Renderer":1},fors:{p5:1},namespaces:{},module:"Rendering",file:"src/core/p5.Renderer.js",line:10,description:"<p>Thin wrapper around a renderer, to be used for creating a\ngraphics buffer object. Use this class if you need\nto draw into an off-screen graphics buffer. The two parameters define the\nwidth and height in pixels. The fields and methods for this class are\nextensive, but mirror the normal drawing API for p5.</p>\n"},Transform:{name:"Transform",submodules:{},elements:{},classes:{},fors:{p5:1},namespaces:{},module:"Transform",file:"src/core/transform.js",line:1,requires:["core","constants"]},Vertex:{name:"Vertex",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Shape",namespace:"",file:"src/core/vertex.js",line:1,requires:["core","constants"]},Data:{name:"Data",submodules:{Dictionary:1,"Array Functions":1,"String Functions":1},elements:{},classes:{"p5.TypedDict":1,"p5.StringDict":1,"p5.NumberDict":1},fors:{"p5.TypedDict":1,p5:1},namespaces:{},file:"src/data/p5.TypedDict.js",line:351},Dictionary:{name:"Dictionary",submodules:{},elements:{},classes:{"p5.TypedDict":1,"p5.StringDict":1,"p5.NumberDict":1},fors:{"p5.TypedDict":1},is_submodule:1,namespaces:{},module:"Data",namespace:"",file:"src/data/p5.TypedDict.js",line:351,requires:["core\n\nThis module defines the p5 methods for the p5 Dictionary classes\nthese classes StringDict and NumberDict are for storing and working\nwith key","value pairs"],description:"<p>Base class for all p5.Dictionary types. More specifically\n typed Dictionary objects inherit from this</p>\n"},Events:{name:"Events",submodules:{Acceleration:1,Keyboard:1,Mouse:1,Touch:1},elements:{},classes:{},fors:{p5:1},namespaces:{}},Acceleration:{name:"Acceleration",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Events",namespace:"",file:"src/events/acceleration.js",line:1,requires:["core"]},Keyboard:{name:"Keyboard",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Events",namespace:"",file:"src/events/keyboard.js",line:1,requires:["core"]},Mouse:{name:"Mouse",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Events",namespace:"",file:"src/events/mouse.js",line:1,requires:["core","constants"]},Touch:{name:"Touch",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Events",namespace:"",file:"src/events/touch.js",line:1,requires:["core"]},Image:{name:"Image",submodules:{Pixels:1},elements:{},classes:{"p5.Image":1},fors:{p5:1},namespaces:{},module:"Image",file:"src/image/p5.Image.js",line:23,requires:["core"],description:"<p>Creates a new p5.Image. A p5.Image is a canvas backed representation of an\nimage.\n<br><br>\np5 can display .gif, .jpg and .png images. Images may be displayed\nin 2D and 3D space. Before an image is used, it must be loaded with the\nloadImage() function. The p5.Image class contains fields for the width and\nheight of the image, as well as an array called pixels[] that contains the\nvalues for every pixel in the image.\n<br><br>\nThe methods described below allow easy access to the image's pixels and\nalpha channel and simplify the process of compositing.\n<br><br>\nBefore using the pixels[] array, be sure to use the loadPixels() method on\nthe image to make sure that the pixel data is properly loaded.</p>\n"},"Loading & Displaying":{name:"Loading & Displaying",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Typography",namespace:"",file:"src/image/loading_displaying.js",line:1,requires:["core"]},Pixels:{name:"Pixels",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Image",namespace:"",file:"src/image/pixels.js",line:1,requires:["core"]},IO:{name:"IO",submodules:{"Color Conversion":1,Input:1,Output:1,Table:1,XML:1,"Time & Date":1},elements:{},classes:{p5:1,"p5.Table":1,"p5.TableRow":1,"p5.XML":1},fors:{p5:1},namespaces:{},file:"src/io/p5.XML.js",line:11},Input:{name:"Input",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"IO",namespace:"",file:"src/io/files.js",line:1,requires:["core"]},Output:{name:"Output",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"IO",namespace:"",file:"src/io/files.js",line:892},Table:{name:"Table",submodules:{},elements:{},classes:{"p5.Table":1,"p5.TableRow":1},fors:{},is_submodule:1,namespaces:{},module:"IO",namespace:"",file:"src/io/p5.TableRow.js",line:11,requires:["core"],description:"<p>Table objects store data with multiple rows and columns, much\nlike in a traditional spreadsheet. Tables can be generated from\nscratch, dynamically, or using data from an existing file.</p>\n"},XML:{name:"XML",submodules:{},elements:{},classes:{"p5.XML":1},fors:{},is_submodule:1,namespaces:{},module:"IO",namespace:"",file:"src/io/p5.XML.js",line:11,requires:["core"],description:"<p>XML is a representation of an XML object, able to parse XML code. Use\nloadXML() to load external XML files and create XML objects.</p>\n"},Math:{name:"Math",submodules:{Calculation:1,Noise:1,Random:1,Trigonometry:1},elements:{},classes:{"p5.Vector":1},fors:{p5:1},namespaces:{},module:"Math",file:"src/math/p5.Vector.js",line:13,requires:["core"],description:"<p>A class to describe a two or three dimensional vector, specifically\na Euclidean (also known as geometric) vector. A vector is an entity\nthat has both magnitude and direction. The datatype, however, stores\nthe components of the vector (x, y for 2D, and x, y, z for 3D). The magnitude\nand direction can be accessed via the methods mag() and heading().\n<br><br>\nIn many of the p5.js examples, you will see p5.Vector used to describe a\nposition, velocity, or acceleration. For example, if you consider a rectangle\nmoving across the screen, at any given instant it has a position (a vector\nthat points from the origin to its location), a velocity (the rate at which\nthe object's position changes per time unit, expressed as a vector), and\nacceleration (the rate at which the object's velocity changes per time\nunit, expressed as a vector).\n<br><br>\nSince vectors represent groupings of values, we cannot simply use\ntraditional addition/multiplication/etc. Instead, we'll need to do some\n"vector" math, which is made easy by the methods inside the p5.Vector class.</p>\n"},Calculation:{name:"Calculation",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Math",namespace:"",file:"src/math/calculation.js",line:1,requires:["core"]},Noise:{name:"Noise",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Math",namespace:"",file:"src/math/noise.js",line:14,requires:["core"]},Random:{name:"Random",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Math",namespace:"",file:"src/math/random.js",line:1,requires:["core"]},Trigonometry:{name:"Trigonometry",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Math",namespace:"",file:"src/math/trigonometry.js",line:1,requires:["core","polargeometry","constants"]},Typography:{name:"Typography",submodules:{Attributes:1,"Loading & Displaying":1,Font:1},elements:{},classes:{"p5.Font":1},fors:{p5:1},namespaces:{},file:"src/typography/p5.Font.js",line:21},Font:{name:"Font",submodules:{},elements:{},classes:{"p5.Font":1},fors:{},is_submodule:1,namespaces:{},module:"Typography",namespace:"",file:"src/typography/p5.Font.js",line:21,description:"<p>This module defines the p5.Font class and functions for\ndrawing text to the display canvas.</p>\n",requires:["core","constants"]},"Array Functions":{name:"Array Functions",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Data",namespace:"",file:"src/utilities/array_functions.js",line:1,requires:["core"]},"String Functions":{name:"String Functions",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Data",namespace:"",file:"src/utilities/string_functions.js",line:1,requires:["core"]},"Time & Date":{name:"Time & Date",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"IO",namespace:"",file:"src/utilities/time_date.js",line:1,requires:["core"]},"Lights, Camera":{name:"Lights, Camera",submodules:{Camera:1,Lights:1,Material:1},elements:{},classes:{"p5.Geometry":1,"p5.RendererGL":1},fors:{p5:1},namespaces:{},file:"src/webgl/p5.RendererGL.js",line:20},Camera:{name:"Camera",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Lights, Camera",namespace:"",file:"src/webgl/camera.js",line:1,requires:["core"]},Lights:{name:"Lights",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Lights, Camera",namespace:"",file:"src/webgl/light.js",line:1,requires:["core"]},"3D Models":{name:"3D Models",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Shape",namespace:"",file:"src/webgl/loading.js",line:1,requires:["core","p5.Geometry"]},Material:{name:"Material",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Lights, Camera",namespace:"",file:"src/webgl/material.js",line:1,requires:["core"]},"3D Primitives":{name:"3D Primitives",submodules:{},elements:{},classes:{},fors:{p5:1},is_submodule:1,namespaces:{},module:"Shape",namespace:"",file:"src/webgl/primitives.js",line:1,requires:["core","p5.Geometry"]},"p5.dom":{name:"p5.dom",submodules:{},elements:{},classes:{"p5.dom":1,"p5.MediaElement":1,"p5.File":1},fors:{"p5.dom":1,"p5.Element":1},namespaces:{},module:"p5.dom",file:"lib/addons/p5.dom.js",line:2196,description:'<p><p>The web is much more than just canvas and p5.dom makes it easy to interact\nwith other HTML5 objects, including text, hyperlink, image, input, video,\naudio, and webcam.</p></p>\n<p><p>There is a set of creation methods, DOM manipulation methods, and\nan extended p5.Element that supports a range of HTML elements. See the\n<a href="https://github.com/processing/p5.js/wiki/Beyond-the-canvas">\nbeyond the canvas tutorial</a> for a full overview of how this addon works.</p>\n<p><p>Methods and properties shown in black are part of the p5.js core, items in\nblue are part of the p5.dom library. You will need to include an extra file\nin order to access the blue functions. See the\n<a href="http://p5js.org/libraries/#using-a-library">using a library</a>\nsection for information on how to include this library. p5.dom comes with\n<a href="http://p5js.org/download">p5 complete</a> or you can download the single file\n<a href="https://raw.githubusercontent.com/lmccart/p5.js/master/lib/addons/p5.dom.js">\nhere</a>.</p></p>\n<p><p>See <a href="https://github.com/processing/p5.js/wiki/Beyond-the-canvas">tutorial: beyond the canvas</a>\nfor more info on how to use this libary.</a></p>\n',tag:"main",itemtype:"main"},"p5.sound":{name:"p5.sound",submodules:{},elements:{},classes:{p5:1,"p5.sound":1,"p5.SoundFile":1,"p5.Amplitude":1,"p5.FFT":1,"p5.Signal":1,"p5.Oscillator":1,"p5.SinOsc":1,"p5.TriOsc":1,"p5.SawOsc":1,"p5.SqrOsc":1,"p5.Env":1,"p5.Pulse":1,"p5.Noise":1,"p5.AudioIn":1,"p5.Effect":1,"p5.Filter":1,"p5.LowPass":1,"p5.HighPass":1,BandPass:1,"p5.Delay":1,"p5.Reverb":1,"p5.Convolver":1,"p5.Phrase":1,"p5.Part":1,"p5.Score":1,"p5.Compressor":1,"p5.SoundRecorder":1,"p5.PeakDetect":1,"p5.Gain":1,"p5.Distortion":1},fors:{"p5.sound":1},namespaces:{},module:"p5.sound",file:"lib/addons/p5.sound.js",line:10410,description:'<p>p5.sound extends p5 with <a href="http://caniuse.com/audio-api"\ntarget="_blank">Web Audio</a> functionality including audio input,\nplayback, analysis and synthesis.\n<br/><br/>\n<a href="#/p5.SoundFile"><b>p5.SoundFile</b></a>: Load and play sound files.<br/>\n<a href="#/p5.Amplitude"><b>p5.Amplitude</b></a>: Get the current volume of a sound.<br/>\n<a href="#/p5.AudioIn"><b>p5.AudioIn</b></a>: Get sound from an input source, typically\n a computer microphone.<br/>\n<a href="#/p5.FFT"><b>p5.FFT</b></a>: Analyze the frequency of sound. Returns\n results from the frequency spectrum or time domain (waveform).<br/>\n<a href="#/p5.Oscillator"><b>p5.Oscillator</b></a>: Generate Sine,\n Triangle, Square and Sawtooth waveforms. Base class of\n <a href="#/p5.Noise">p5.Noise</a> and <a href="#/p5.Pulse">p5.Pulse</a>.\n <br/>\n<a href="#/p5.Env"><b>p5.Env</b></a>: An Envelope is a series\n of fades over time. Often used to control an object's\n output gain level as an "ADSR Envelope" (Attack, Decay,\n Sustain, Release). Can also modulate other parameters.<br/>\n<a href="#/p5.Delay"><b>p5.Delay</b></a>: A delay effect with\n parameters for feedback, delayTime, and lowpass filter.<br/>\n<a href="#/p5.Filter"><b>p5.Filter</b></a>: Filter the frequency range of a\n sound.\n<br/>\n<a href="#/p5.Reverb"><b>p5.Reverb</b></a>: Add reverb to a sound by specifying\n duration and decay. <br/>\n<b><a href="#/p5.Convolver">p5.Convolver</a>:</b> Extends\n<a href="#/p5.Reverb">p5.Reverb</a> to simulate the sound of real\n physical spaces through convolution.<br/>\n<b><a href="#/p5.SoundRecorder">p5.SoundRecorder</a></b>: Record sound for playback\n / save the .wav file.\n<b><a href="#/p5.Phrase">p5.Phrase</a></b>, <b><a href="#/p5.Part">p5.Part</a></b> and\n<b><a href="#/p5.Score">p5.Score</a></b>: Compose musical sequences.\n<br/><br/>\np5.sound is on <a href="https://github.com/therewasaguy/p5.sound/">GitHub</a>.\nDownload the latest version\n<a href="https://github.com/therewasaguy/p5.sound/blob/master/lib/p5.sound.js">here</a>.</p>\n',tag:"main",itemtype:"main"}},classes:{p5:{name:"p5",shortname:"p5",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"p5.sound",submodule:"p5.sound",namespace:"",file:"lib/addons/p5.sound.js",line:409},"p5.Color":{name:"p5.Color",shortname:"p5.Color",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"Color",submodule:"Creating & Reading",namespace:"",file:"src/color/p5.Color.js",line:14,description:"<p>We define colors to be immutable objects. Each color stores the color mode\nand level maxes that applied at the time of its construction. These are\nused to interpret the input arguments and to format the output e.g. when\nsaturation() is requested.</p>\n<p>Internally we store an array representing the ideal RGBA values in floating\npoint form, normalized from 0 to 1. From this we calculate the closest\nscreen color (RGBA levels from 0 to 255) and expose this to the renderer.</p>\n<p>We also cache normalized, floating point components of the color in various\nrepresentations as they are calculated. This is done to prevent repeating a\nconversion that has already been performed.</p>\n",is_constructor:1},"p5.Element":{name:"p5.Element",shortname:"p5.Element",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"DOM",submodule:"DOM",namespace:"",file:"src/core/p5.Element.js",line:9,description:'<p>Base class for all elements added to a sketch, including canvas,\ngraphics buffers, and other HTML elements. Methods in blue are\nincluded in the core functionality, methods in brown are added\nwith the <a href="http://p5js.org/reference/#/libraries/p5.dom">p5.dom\nlibrary</a>.\nIt is not called directly, but p5.Element\nobjects are created by calling createCanvas, createGraphics,\nor in the p5.dom library, createDiv, createImg, createInput, etc.</p>\n',is_constructor:1,params:[{name:"elt",description:"<p>DOM node that is wrapped</p>\n",type:"String"},{name:"pInst",description:"<p>pointer to p5 instance</p>\n",type:"P5",optional:!0}]},"p5.Graphics":{name:"p5.Graphics",shortname:"p5.Graphics",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"Rendering",submodule:"Rendering",namespace:"",file:"src/core/p5.Graphics.js",line:10,description:"<p>Thin wrapper around a renderer, to be used for creating a\ngraphics buffer object. Use this class if you need\nto draw into an off-screen graphics buffer. The two parameters define the\nwidth and height in pixels. The fields and methods for this class are\nextensive, but mirror the normal drawing API for p5.</p>\n",is_constructor:1,extends:"p5.Element",params:[{name:"w",description:"<p>width</p>\n",type:"Number"},{name:"h",description:"<p>height</p>\n",type:"Number"},{name:"renderer",description:"<p>the renderer to use, either P2D or WEBGL</p>\n",type:"Constant"},{name:"pInst",description:"<p>pointer to p5 instance</p>\n",type:"P5",optional:!0}]},"p5.Renderer":{name:"p5.Renderer",shortname:"p5.Renderer",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"Rendering",submodule:"Rendering",namespace:"",file:"src/core/p5.Renderer.js",line:10,description:"<p>Main graphics and rendering context, as well as the base API\nimplementation for p5.js "core". To be used as the superclass for\nRenderer2D and Renderer3D classes, respecitvely.</p>\n",is_constructor:1,extends:"p5.Element",params:[{name:"elt",description:"<p>DOM node that is wrapped</p>\n",type:"String"},{name:"pInst",description:"<p>pointer to p5 instance</p>\n",type:"P5",optional:!0},{name:"isMainCanvas",description:"<p>whether we're using it as main canvas</p>\n",type:"Boolean",optional:!0}]},"p5.TypedDict":{name:"p5.TypedDict",shortname:"p5.TypedDict",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"Data",submodule:"Dictionary",namespace:"",file:"src/data/p5.TypedDict.js",line:48,description:"<p>Base class for all p5.Dictionary types. More specifically\n typed Dictionary objects inherit from this</p>\n",is_constructor:1},"p5.StringDict":{name:"p5.StringDict",shortname:"p5.StringDict",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"Data",submodule:"Dictionary",namespace:"",file:"src/data/p5.TypedDict.js",line:330,description:"<p>A Dictionary class for Strings.</p>\n",is_constructor:1,extends:"p5.TypedDict"},"p5.NumberDict":{name:"p5.NumberDict",shortname:"p5.NumberDict",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"Data",submodule:"Dictionary",namespace:"",file:"src/data/p5.TypedDict.js",line:351,description:"<p>A simple Dictionary class for Numbers.</p>\n",is_constructor:1,extends:"p5.TypedDict"},"p5.Image":{name:"p5.Image",shortname:"p5.Image",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"Image",submodule:"Image",namespace:"",file:"src/image/p5.Image.js",line:23,description:"<p>Creates a new p5.Image. A p5.Image is a canvas backed representation of an\nimage.\n<br><br>\np5 can display .gif, .jpg and .png images. Images may be displayed\nin 2D and 3D space. Before an image is used, it must be loaded with the\nloadImage() function. The p5.Image class contains fields for the width and\nheight of the image, as well as an array called pixels[] that contains the\nvalues for every pixel in the image.\n<br><br>\nThe methods described below allow easy access to the image's pixels and\nalpha channel and simplify the process of compositing.\n<br><br>\nBefore using the pixels[] array, be sure to use the loadPixels() method on\nthe image to make sure that the pixel data is properly loaded.</p>\n",is_constructor:1,params:[{name:"width",description:"",type:"Number"},{name:"height",description:"",type:"Number"}]},"p5.Table":{name:"p5.Table",shortname:"p5.Table",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"IO",submodule:"Table",namespace:"",file:"src/io/p5.Table.js",line:36, +description:"<p>Table objects store data with multiple rows and columns, much\nlike in a traditional spreadsheet. Tables can be generated from\nscratch, dynamically, or using data from an existing file.</p>\n",is_constructor:1,params:[{name:"rows",description:"<p>An array of p5.TableRow objects</p>\n",type:"p5.TableRow[]",optional:!0}]},"p5.TableRow":{name:"p5.TableRow",shortname:"p5.TableRow",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"IO",submodule:"Table",namespace:"",file:"src/io/p5.TableRow.js",line:11,description:"<p>A TableRow object represents a single row of data values,\nstored in columns, from a table.</p>\n<p>A Table Row contains both an ordered array, and an unordered\nJSON object.</p>\n",is_constructor:1,params:[{n°äŒf +example:["\n<div><code>\nvar noise, env, delay;\n\nfunction setup() {\n background(0);\n noStroke();\n fill(255);\n textAlign(CENTER);\n text('click to play', width/2, height/2);\n\n noise = new p5.Noise('brown');\n noise.amp(0);\n noise.start();\n\n delay = new p5.Delay();\n\n // delay.process() accepts 4 parameters:\n // source, delayTime, feedback, filter frequency\n // play with these numbers!!\n delay.process(noise, .12, .7, 2300);\n\n // play the noise with an envelope,\n // a series of fades ( time / value pairs )\n env = new p5.Env(.01, 0.2, .2, .1);\n}\n\n// mouseClick triggers envelope\nfunction mouseClicked() {\n // is mouse over canvas?\n if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) {\n env.play(noise);\n }\n}\n</code></div>"]},"p5.Reverb":{name:"p5.Reverb",shortname:"p5.Reverb",classitems:[],plugins:[],extensions:[],plugin_for:[],extension_for:[],module:"p5.sound",submodule:"p5.sound",namespace:"",file:"lib/addons/p5.sound.js",line:8341,description:'<p>Reverb adds depth to a sound through a large number of decaying\nechoes. It creates the perception that sound is occurring in a\nphysical space. The p5.Reverb has paramters for Time (how long does the\nreverb last) and decayRate (how much the sound decays with each echo)\nthat can be set with the .set() or .process() methods. The p5.Convolver\nextends p5.Reverb allowing you to recreate the sound of actual physical\nspaces through convolution.</p>\n<p>This class extends <a href = "/reference/#/p5.Effect">p5.Effect</a>.<br>Methods <a href = "/reference/#/p5.Effect/amp">amp()</a>, <a href = "/reference/#/p5.Effect/°äŒf +description:"<p>Blends two colors to find a third color somewhere between them. The amt\nparameter is the amount to interpolate between the two values where 0.0\nequal to the first color, 0.1 is very near the first color, 0.5 is halfway\nin between, etc. An amount below 0 will be treated as 0. Likewise, amounts\nabove 1 will be capped at 1. This is different from the behavior of lerp(),\nbut necessary because otherwise numbers outside the range will produce\nstrange and unexpected colors.\n<br><br>\nThe way that colours are interpolated depends on the current color mode.</p>\n",itemtype:"method",name:"lerpColor",params:[{name:"c1",description:"<p>interpolate from this color</p>\n",type:"p5.Color"},{name:"c2",description:"<p>interpolate to this color</p>\n",type:"p5.Color"},{name:"amt",description:"<p>number between 0 and 1</p>\n",type:"Number"}],return:{description:"interpolated color",type:"p5.Color"},example:["\n<div>\n<code>\ncolorMode(RGB);\nstroke(255);\nbackground(51);\nfrom = color(218, 165, 32);\nto = color(72, 61, 139);\ncolorMode(RGB); // Try changing to HSB.\ninterA = lerpColor(from, to, .33);\ninterB = lerpColor(from, to, .66);\nfill(from);\nrect(10, 20, 20, 60);\nfill(interA);\nrect(30, 20, 20, 60);\nfill(interB);\nrect(50, 20, 20, 60);\nfill(to);\nrect(70, 20, 20, 60);\n</code>\n</div>"],alt:"4 rects one tan, brown, brownish purple, purple, with white outlines & 20x60",class:"p5",module:"Color",submodule:"Creating & Reading"},{file:"src/color/creating_reading.js",line:489,description:"<p>Extracts the HSL lightness value from a color or pixel array.</p>\n",itemtype:"method",name:"lightness",params:[{name:"color",description:"<p>p5.Color object or pixel array</p>\n",type:"p5.Color|Array"}],return:{description:"the lightness",type:"Number"},example:["\n<div>\n<code>\nnoStroke();\ncolorMode(HSL);\nc = color(156, 100, 50, 1);\nfill(c);\nrect(15, 20, 35, 60);\nvalue = lightness(c); // Sets 'value' to 50\nfill(value);\nrect(50, 20, 35, 60);\n</code>\n</div>"],alt:"light pastel green rect on left and dark grey rect on right, both 35x60.",class:"p5",module:"Color",submodule:"Creating & Reading"},{file:"src/color/creating_reading.js",line:518,description:"<p>Extracts the red value from a color or pixel array.</p>\n",itemtype:"method",name:"red",params:[{name:"color",description:"<p>p5.Color object or pixel array</p>\n",type:"p5.Color|Array"}],return:{description:"the red value",type:"Number"},example:["\n<div>\n<code>\nc = color(255, 204, 0); // Define color 'c'\nfill(c); // Use color variable 'c' as fill color\nrect(15, 20, 35, 60); // Draw left rectangle\n\nredValue = red(c); // Get red in 'c'\nprint(redValue); // Print \"255.0\"\nfill(redValue, 0, 0); // Use 'redValue' in new fill\nrect(50, 20, 35, 60); // Draw right rectangle\n</code>\n</div>\n\n<div>\n<code>\°äŒf +description:"<p>Modifies the location from which rectangles are drawn by changing the way\nin which parameters given to rect() are interpreted.\n<br><br>\nThe default mode is rectMode(CORNER), which interprets the first two\nparameters of rect() as the upper-left corner of the shape, while the\nthird and fourth parameters are its width and height.\n<br><br>\nrectMode(CORNERS) interprets the first two parameters of rect() as the\nlocation of one corner, and the third and fourth parameters as the\nlocation of the opposite corner.\n<br><br>\nrectMode(CENTER) interprets the first two parameters of rect() as the\nshape's center point, while the third and fourth parameters are its\nwidth and height.\n<br><br>\nrectMode(RADIUS) also uses the first two parameters of rect() as the\nshape's center point, but uses the third and fourth parameters to specify\nhalf of the shapes's width and height.\n<br><br>\nThe parameter must be written in ALL CAPS because Javascript is a\ncase-sensitive language.</p>\n",itemtype:"method",name:"rectMode",params:[{name:"mode",description:"<p>either CORNER, CORNERS, CENTER, or RADIUS</p>\n",type:"Constant"}],chainable:1,example:["\n<div>\n<code>\nrectMode(CORNER); // Default rectMode is CORNER\nfill(255); // Set fill to white\nrect(25, 25, 50, 50); // Draw white rect using CORNER mode\n\nrectMode(CORNERS); // Set rectMode to CORNERS\nfill(100); // Set fill to gray\nrect(25, 25, 50, 50); // Draw gray rect using CORNERS mode\n</code>\n</div>\n\n<div>\n<code>\nrectMode(RADIUS); // Set rectMode to RADIUS\nfill(255); // Set fill to white\nrect(50, 50, 30, 30); // Draw white rect using RADIUS mode\n\nrectMode(CENTER); // Set rectMode to CENTER\nfill(100); // Set fill to gray\nrect(50, 50, 30, 30); // Draw gray rect using CENTER mode\n</code>\n</div>"],alt:"50x50 white rect at center and 25x25 grey rect in the top left of the other.\n50x50 white rect at center and 25x25 grey rect in the center of the other.",class:"p5",module:"Shape",submodule:"Attributes"},{file:"src/core/attributes.js",line:174,description:"<p>Draws all geometry with smooth (anti-aliased) edges. smooth() will also\nimprove image quality of resized images. Note that smooth() is active by\ndefault; noSmooth() can be used to disable smoothing of geometry,\nimages, and fonts.</p>\n",itemtype:"method",name:"smooth",chainable:1,example:["\n<div>\n<code>\nbackground(0);\nnoStroke();\nsmooth();\nellipse(30, 48, 36, 36);\nnoSmooth();\nellipse(70, 48, 36, 36);\n</code>\n</div>"],alt:"2 pixelated 36x36 white ellipses one left one right of center. On black.",class:"p5",module:"Shape",submodule:"Attributes"},{file:"src/core/attributes.js",line:203,description:"<p>Sets the style for rendering line endings. These ends are either squared,\nextended, or rounded, each of which specified with the corresponding\nparameters: SQUARE, PROJECT, and ROUND. The default cap is ROUND.</p>\n",itemtype:"method",name:"strokeCap",params:[{name:"cap",description:"<p>either SQUARE, PROJECT, or ROUND</p>\n",type:"Constant"}],chainable:1,example:["\n<div>\n<code>\nstrokeWeight(12.0);\nstrokeCap(ROUND);\nline(20, 30, 80, 30);\nstrokeCap(SQUARE);\nline(20, 50, 80, 50);\nstrokeCap(PROJECT);\nline(20, 70, 80, 70);\n</code>\n</div>"],alt:"3 lines. Top line: rounded ends, mid: squared, bottom:longer squared ends.",class:"p5",module:"Shape",submodule:"Attributes"},{file:"src/core/attributes.js",line:237,description:"<p>Sets the style of the joints which connect line segments. These joints\nare either mitered, beveled, or rounded and specified with the\ncorresponding parameters MITER, BEVEL, and ROUND. The default joint is\nMITER.</p>\n",itemtype:"method",name:"strokeJoin",params:[{name:"join",description:"<p>either MITER, BEVEL, ROUND</p>\n",type:"Constant"}],chainable:1,example:["\n<div>\n<code>\nnoFill();\nstrokeWeight(10.0);\nstrokeJoin(MITER);\nbeginShape();\nvertex(35, 20);\nvertex(65, 50);\nvertex(35, 80);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nnoFill();\nstrokeWeight(10.0);\nstrokeJoin(BEVEL);\nbeginShape();\nvertex(35, 20);\nvertex(65, 50);\nvertex(35, 80);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nnoFill();\nstrokeWeight(10.0);\nstrokeJoin(ROUND);\nbeginShape();\nvertex(35, 20);\nvertex(65, 50);\nv°äŒf +description:"<p>y-coordinate for the second point</p>\n",type:"Number"},{name:"x4",description:"<p>x-coordinate for the ending control point</p>\n",type:"Number"},{name:"y4",description:"<p>y-coordinate for the ending control point</p>\n",type:"Number"}],return:{description:"the p5 object",type:"P5"}},{line:308,params:[{name:"z1",description:"<p>z-coordinate for the beginning control point</p>\n",type:"Number"},{name:"z2",description:"<p>z-coordinate for the first point</p>\n",type:"Number"},{name:"z3",description:"<p>z-coordinate for the second point</p>\n",type:"Number"},{name:"z4",description:"<p>z-coordinate for the ending control point</p>\n",type:"Number"}],chainable:1}]},{file:"src/core/curves.js",line:353,description:"<p>Sets the resolution at which curves display.</p>\n<p>The default value is 20.</p>\n",params:[{name:"resolution",description:"<p>of the curves</p>\n",type:"Number"}],chainable:1,example:["\n<div>\n<code>\nbackground(204);\ncurveDetail(20);\ncurve(5, 26, 5, 26, 73, 24, 73, 61);\n</code>\n</div>"],alt:"white arch shape in top-mid canvas.",class:"p5",module:"Shape",submodule:"Curves"},{file:"src/core/curves.js",line:378,description:"<p>Modifies the quality of forms created with curve() and curveVertex().\nThe parameter tightness determines how the curve fits to the vertex\npoints. The value 0.0 is the default value for tightness (this value\ndefines the curves to be Catmull-Rom splines) and the value 1.0 connects\nall the points with straight lines. Values within the range -5.0 and 5.0\nwill deform the curves but will leave them recognizable and as values\nincrease in magnitude, they will continue to deform.</p>\n",itemtype:"method",name:"curveTightness",params:[{name:"amount",description:"<p>of deformation from the original vertices</p>\n",type:"Number"}],chainable:1,example:["\n<div>\n<code>\n// Move the mouse left and right to see the curve change\n\nfunction setup() {\n createCanvas(100, 100);\n noFill();\n}\n\nfunction draw() {\n background(204);\n var t = map(mouseX, 0, width, -5, 5);\n curveTightness(t);\n beginShape();\n curveVertex(10, 26);\n curveVertex(10, 26);\n curveVertex(83, 24);\n curveVertex(83, 61);\n curveVertex(25, 65);\n curveVertex(25, 65);\n endShape();\n}\n</code>\n</div>"],alt:"Line shaped like right-facing arrow,points move with mouse-x and warp shape.",class:"p5",module:"Shape",submodule:"Curves"},{file:"src/core/curves.js",line:423,description:"<p>Evaluates the curve at position t for points a, b, c, d.\nThe parameter t varies between 0 and 1, a and d are points\non the curve, and b and c are the control points.\nThis can be done once with the x coordinates and a second time\nwith the y coordinates to get the location of a curve at t.</p>\n",itemtype:"method",name:"curvePoint",params:[{name:"a",description:"<p>coordinate of first point on the curve</p>\n",type:"Number"},{name:"b",description:"<p>coordinate of first control point</p>\n",type:"Number"},{name:"c",description:"<p>coordinate of second control point</p>\n",type:"Number"},{name:"d",description:"<p>coordinate of second point on the curve</p>\n",type:"Number"},{name:"t",description:"<p>value between 0 and 1</p>\n",type:"Number"}],return:{description:"bezier value at position t",type:"Number"},example:["\n<div>\n<code>\nnoFill();\ncurve(5, 26, 5, 26, 73, 24, 73, 61);\ncurve(5, 26, 73, 24, 73, 61, 15, 65);\nfill(255);\nellipseMode(CENTER);\nsteps = 6;\nfor (i = 0; i <= steps; i++) {\n t = i / steps;\n x = curvePoint(5, 5, 73, 73, t);\n y = curvePoint(26, 26, 24, 61, t);\n ellipse(x, y, 5, 5);\n x = curvePoint(5, 73, 73, 15, t);\n y = curvePoint(26, 24, 61, 65, t);\n ellipse(x, y, 5, 5);\n}\n</code>\n</div>\n\nline hooking down to right-bottom with 13 5x5 white ellipse points"],class:"p5",module:"Shape",submodule:"Curves"},{file:"src/core/curves.js",line:476,description:"<p>Evaluates the tangent to the curve at position t for points a, b, c, d.\nThe parameter t varies between 0 and 1, a and d are points on the curve,\nand b and c are the control points.</p>\n",itemtype:"method",name:"curveTangent",params:[{name:"a",description:"<p>coordinate of first point on the curve</p>\n",type:"Number"},{name:"b",description:"<p>coordinate of first control point</p>\n",type:"Number"},{name:"c",description:"<p>coordinate of second control point</p>\n",type:"Number"},{name:"d",description:"<p>coordinate of second point on the curve</p>\n",type:"Number"},{name:"t",description:"<p>value between 0 and 1</p>\n",type:"Number"}],return:{description:"the tangent at position t",type:"Number"},example:["\n<div>\n<code>\nnoFill();\ncurve(5, 26, 73, 24, 73, 61, 15, 65);\nsteps = 6;\nfor (i = 0; i <= steps; i++) {\n t = i / steps;\n x = curvePoint(5, 73, 73, 15, t);\n y = curvePoint(26, 24, 61, 65, t);\n //ellipse(x, y, 5, 5);\n tx = curveTangent(5, 73, 73, 15, t);\n ty = curveTangent(26, 24, 61, 65, t);\n a = atan2(ty, tx);\n a -= PI/2.0;\n line(x, y, cos(a)*8 + x, sin(a)*8 + y);\n}\n</code>\n</div>"],alt:"right curving line mid-right o°äŒf +description:"<p>The .input() function is called when any user input is\ndetected with an element. The input event is often used\nto detect keystrokes in a input element, or changes on a\nslider element. This can be used to attach an element specific\nevent listener.</p>\n",itemtype:"method",name:"input",params:[{name:"fxn",description:"<p>function to be fired on user input.</p>\n",type:"Function"}],chainable:1,example:["\n<div class='norender'><code>\n// Open your console to see the output\nfunction setup() {\n var inp = createInput('');\n inp.input(myInputEvent);\n}\n\nfunction myInputEvent() {\n console.log('you are typing: ', this.value());\n}\n</code></div>"],alt:"no display.",class:"p5.Element",module:"DOM",submodule:"DOM"},{file:"src/core/p5.Element.js",line:624,description:"<p>The .mouseOut() function is called once after every time a\nmouse moves off the element. This can be used to attach an\nelement specific event listener.</p>\n",itemtype:"method",name:"mouseOut",params:[{name:"fxn",description:"<p>function to be fired when mouse is\n moved off the element.</p>\n",type:"Function"}],chainable:1,example:["\n<div class='norender'><code>\nvar cnv;\nvar d;\nvar g;\nfunction setup() {\n cnv = createCanvas(100, 100);\n cnv.mouseOut(changeGray);\n d = 10;\n}\n\nfunction draw() {\n ellipse(width/2, height/2, d, d);\n}\n\nfunction changeGray() {\n d = d + 10;\n if (d > 100) {\n d = 0;\n }\n}\n</code></div>"],alt:"no display.",class:"p5.Element",module:"DOM",submodule:"DOM"},{file:"src/core/p5.Element.js",line:665,description:"<p>The .touchStarted() function is called once after every time a touch is\nregistered. This can be used to attach element specific event listeners.</p>\n",itemtype:"method",name:"touchStarted",params:[{name:"fxn",description:"<p>function to be fired when touch is\n started over the element.</p>\n",type:"Function"}],chainable:1,example:["\n<div class='norender'><code>\nvar cnv;\nvar d;\nvar g;\nfunction setup() {\n cnv = createCanvas(100, 100);\n cnv.touchStarted(changeGray); // attach listener for\n // canvas click only\n d = 10;\n g = 100;\n}\n\nfunction draw() {\n background(g);\n ellipse(width/2, height/2, d, d);\n}\n\n// this function fires with any touch anywhere\nfunction touchStarted() {\n d = d + 10;\n}\n\n// this function fires only when cnv is clicked\nfunction changeGray() {\n g = random(0, 255);\n}\n</code></div>"],alt:"no display.",class:"p5.Element",module:"DOM",submodule:"DOM"},{file:"src/core/p5.Element.js",line:712,description:"<p>The .touchMoved() function is called once after every time a touch move is\nregistered. This can be used to attach element specific event listeners.</p>\n",itemtype:"method",name:"touchMoved",params:[{name:"fxn",description:"<p>function to be fired when touch is moved\n over the element.</p>\n",type:"Function"}],chainable:1,example:["\n<div class='norender'><code>\nvar cnv;\nvar g;\nfunction setup() {\n cnv = createCanvas(100, 100);\n cnv.touchMoved(changeGray); // attach listener for\n // canvas click only\n g = 100;\n}\n\nfunction draw() {\n background(g);\n}\n\n// this function fires only when cnv is clicked\nfunction changeGray() {\n g = random(0, 255);\n}\n</code></div>"],alt:"no display.",class:"p5.Element",module:"DOM",submodule:"DOM"},{file:"src/core/p5.Element.js",line:751,description:"<p>The .touchEnded() function is called once after every time a touch is\nregistered. This can be used to attach element specific event listeners.</p>\n",itemtype:"method",name:"touchEnded",params:[{name:"fxn",description:"<p>function to be fired when touch is\n ended over the element.</p>\n",type:"Function"}],chainable:1,example:["\n<div class='norender'><code>\nvar cnv;\nvar d;\nvar g;\nfunction setup() {\n cnv = createCanvas(100, 100);\n cnv.touchEnded(changeGray); // attach listener for\n // canvas click only\n d = 10;\n g = 100;\n}\n\nfunction draw() {\n background(g);\n ellipse(width/2, height/2, d, d);\n}\n\n// this function fires with any touch anywhere\nfunction touchEnded() {\n d = d + 10;\n}\n\n// this function fires only when cnv is clicked\nfunction changeGray() {\n g = random(0, 255);\n}\n</code></div>"],alt:"no display.",class:"p5.Element",module:"DOM",submodule:"DOM"},{file:"src/core/p5.Element.js",line:801,description:"<p>The .dragOver() function is called once after every time a\nfile is dragged over the element. This can be used to attach an\nelement specific event listener.</p>\n",itemtype:"method",name:"dragOver",params:[{name:"fxn",description:"<p>function to be fired when mouse is\n dragged over the element.</p>\n",type:"Function"}],chainable:1,example:["\n<div><code>\n// To test this sketch, simply drag a\n// file over the canvas\nfunction setup() {\n var c = createCanvas(100, 100);\n background(200);\n textAlign(CENTER);\n text('Drag file', width/2, height/2);\n c.dragOver(dragOverCallback);\n}\n\n// This function will be called whenever\n// a file is dragged over the canvas\nfunction dragOverCallback() {\n background(240);\n text('Dragged over', width/2, height/2);\n}\n</code></div>"],alt:"nothing displayed",class:"p5.Element",module:"DOM",submodule:"DOM"},{file:"src/core/p5.Element.js",line:837,description:"<p>The .dragLeave() function is called once after every time a\ndragged file leaves the element area. This can be used to attach an\nelement specific event listener.</p>\n",itemtype:"method",name:"dragLeave",params:[{name:"fxn",description:"<p>function to be fired when mouse is\n dragged over the element.</p>\n",type:"Function"}],chainable:1,example:["\n<div><code>\n// To test this sketch, simply drag a file\n// over and then out of the canvas area\nfunction setup() {\n var c = createCanvas(100, 100);\n background(200);\n textAlign(CENTER);\n text('Drag file', width/2, height/2);\n c.dragLeave(dragLeaveCallback);\n°äŒf +example:["\n<div>\n<code>\ntranslate(30, 20);\nrect(0, 0, 55, 55);\n</code>\n</div>\n\n<div>\n<code>\nrect(0, 0, 55, 55); // Draw rect at original 0,0\ntranslate(30, 20);\nrect(0, 0, 55, 55); // Draw rect at new 0,0\ntranslate(14, 14);\nrect(0, 0, 55, 55); // Draw rect at new 0,0\n</code>\n</div>"],alt:"white 55x55 rect with black outline at center right.\n3 white 55x55 rects with black outlines at top-l, center-r and bottom-r.",class:"p5",module:"Transform",submodule:"Transform"},{file:"src/core/vertex.js",line:22,description:"<p>Use the beginContour() and endContour() functions to create negative\nshapes within shapes such as the center of the letter 'O'. beginContour()\nbegins recording vertices for the shape and endContour() stops recording.\nThe vertices that define a negative shape must "wind" in the opposite\ndirection from the exterior shape. First draw vertices for the exterior\nclockwise order, then for internal shapes, draw vertices\nshape in counter-clockwise.\n<br><br>\nThese functions can only be used within a beginShape()/endShape() pair and\ntransformations such as translate(), rotate(), and scale() do not work\nwithin a beginContour()/endContour() pair. It is also not possible to use\nother shapes, such as ellipse() or rect() within.</p>\n",itemtype:"method",name:"beginContour",chainable:1,example:["\n<div>\n<code>\ntranslate(50, 50);\nstroke(255, 0, 0);\nbeginShape();\n// Exterior part of shape, clockwise winding\nvertex(-40, -40);\nvertex(40, -40);\nvertex(40, 40);\nvertex(-40, 40);\n// Interior part of shape, counter-clockwise winding\nbeginContour();\nvertex(-20, -20);\nvertex(-20, 20);\nvertex(20, 20);\nvertex(20, -20);\nendContour();\nendShape(CLOSE);\n</code>\n</div>"],alt:"white rect and smaller grey rect with red outlines in center of canvas.",class:"p5",module:"Shape",submodule:"Vertex"},{file:"src/core/vertex.js",line:70,description:"<p>Using the beginShape() and endShape() functions allow creating more\ncomplex forms. beginShape() begins recording vertices for a shape and\nendShape() stops recording. The value of the kind parameter tells it which\ntypes of shapes to create from the provided vertices. With no mode\nspecified, the shape can be any irregular polygon.\n<br><br>\nThe parameters available for beginShape() are POINTS, LINES, TRIANGLES,\nTRIANGLE_FAN, TRIANGLE_STRIP, QUADS, and QUAD_STRIP. After calling the\nbeginShape() function, a series of vertex() commands must follow. To stop\ndrawing the shape, call endShape(). Each shape will be outlined with the\ncurrent stroke color and filled with the fill color.\n<br><br>\nTransformations such as translate(), rotate(), and scale() do not work\nwithin beginShape(). It is also not possible to use other shapes, such as\nellipse() or rect() within beginShape().</p>\n",itemtype:"method",name:"beginShape",params:[{name:"kind",description:"<p>either POINTS, LINES, TRIANGLES, TRIANGLE_FAN\n TRIANGLE_STRIP, QUADS, or QUAD_STRIP</p>\n",type:"Constant",optional:!0}],chainable:1,example:["\n<div>\n<code>\nbeginShape();\nvertex(30, 20);\nvertex(85, 20);\nvertex(85, 75);\nvertex(30, 75);\nendShape(CLOSE);\n</code>\n</div>\n\n<div>\n<code>\n// currently not working\nbeginShape(POINTS);\nvertex(30, 20);\nvertex(85, 20);\nvertex(85, 75);\nvertex(30, 75);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nbeginShape(LINES);\nvertex(30, 20);\nvertex(85, 20);\nvertex(85, 75);\nvertex(30, 75);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nnoFill();\nbeginShape();\nvertex(30, 20);\nvertex(85, 20);\nvertex(85, 75);\nvertex(30, 75);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nnoFill();\nbeginShape();\nvertex(30, 20);\nvertex(85, 20);\nvertex(85, 75);\nvertex(30, 75);\nendShape(CLOSE);\n</code>\n</div>\n\n<div>\n<code>\nbeginShape(TRIANGLES);\nvertex(30, 75);\nvertex(40, 20);\nvertex(50, 75);\nvertex(60, 20);\nvertex(70, 75);\nvertex(80, 20);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nbeginShape(TRIANGLE_STRIP);\nvertex(30, 75);\nvertex(40, 20);\nvertex(50, 75);\nvertex(60, 20);\nvertex(70, 75);\nvertex(80, 20);\nvertex(90, 75);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nbeginShape(TRIANGLE_FAN);\nvertex(57.5, 50);\nvertex(57.5, 15);\nvertex(92, 50);\nvertex(57.5, 85);\nvertex(22, 50);\nvertex(57.5, 15);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nbeginShape(QUADS);\nvertex(30, 20);\nvertex(30, 75);\nvertex(50, 75);\nvertex(50, 20);\nvertex(65, 20);\nvertex(65, 75);\nvertex(85, 75);\nvertex(85, 20);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nbeginShape(QUAD_STRIP);\nvertex(30, 20);\nvertex(30, 75);\nvertex(50, 20);\nvertex(50, 75);\nvertex(65, 20);\nvertex(65, 75);\nvertex(85, 20);\nvertex(85, 75);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nbeginShape();\nvertex(20, 20);\nvertex(40, 20);\nvertex(40, 40);\nvertex(60, 40);\nvertex(60, 60);\nvertex(20, 60);\nendShape(CLOSE);\n</code>\n</div>"],alt:"white square-shape with black outline in middle-right of canvas.\n4 black points in a square shape in middle-right of canvas.\n2 horizontal black lines. In the top-right and bottom-right of canvas.\n3 line shape with horizontal on top, vertical in middle and horizontal bottom.\nsquare line shape in middle-right of canvas.\n2 white triangle shapes mid-right canvas. left one pointing up and right down.\n5 horizontal interlocking and alternating white triangles in mid-right canvas.\n4 interlocking white triangles in 45 degree rotated square-shape.\n2 white rectangle shapes in mid-right canvas. Both 20x55.\n3 side-by-side white rectangles center rect is smaller in mid-right canvas.\nThick white l-shape with black outline mid-top-left of canvas.",class:"p5",module:"Shape",submodule:"Vertex"},{file:"src/core/vertex.js",line:267,description:"<p>Specifies vertex coordinates for Bezier curves. Each call to\nbezierVertex() defines the position of two control points and\none anchor point of a Bezier curve, adding a new segment to a\nline or shape.\n<br><br>\nThe first time bezierVertex() is used within a\nbeginShape() call, it must be prefaced with a call to vertex()\nto set the first anchor point. This function must be used between\nbeginShape() and endShape() and only when there is no MODE\nparameter specified to beginShape().</p>\n",itemtype:"method",name:"bezierVertex",params:[{name:"x2",description:"<p>x-coordinate for the first control point</p>\n",type:"Number"},{name:"y2",description:"<p>y-coordinate for the first control point</p>\n",type:"Number"},{name:"x3",description:"<p>x-coordinate for the second control point</p>\n",type:"Number"},{name:"y3",description:"<p>y-coordinate for the second control point</p>\n",type:"Number"},{name:"x4",description:"<p>x-coordinate for the anchor point</p>\n",type:"Number"},{name:"y4",description:"<p>y-coordinate for the anchor point</p>\n",type:"Number"}],chainable:1,example:["\n<div>\n<code>\nnoFill();\nbeginShape();\nvertex(30, 20);\nbezierVertex(80, 0, 80, 75, 30, 75);\nendShape();\n</code>\n</div>\n\n<div>\n<code>\nbeginShape();\nvertex(30, 20);\nbezierVertex(80, 0, 80, °äŒf +description:"<p>The system variable pRotationZ always contains the rotation of the\ndevice along the z axis in the frame previous to the current frame. Value\nis represented as 0 to 359 degrees.\n<br><br>\npRotationZ can also be used with rotationZ to determine the rotate\ndirection of the device along the Z-axis.</p>\n",example:["\n<div class='norender'>\n<code>\n// A simple if statement looking at whether\n// rotationZ - pRotationZ < 0 is true or not will be\n// sufficient for determining the rotate direction\n// in most cases.\n\n// Some extra logic is needed to account for cases where\n// the angles wrap around.\nvar rotateDirection = 'clockwise';\n\nif ((rotationZ - pRotationZ > 0 &&\n rotationZ - pRotationZ < 270)||\n rotationZ - pRotationZ < -270){\n\n rotateDirection = 'clockwise';\n\n} else if (rotationZ - pRotationZ < 0 ||\n rotationZ - pRotationZ > 270){\n\n rotateDirection = 'counter-clockwise';\n\n}\n</code>\n</div>"],alt:"no image to display.",itemtype:"property",name:"pRotationZ",type:"Number",readonly:"",class:"p5",module:"Events",submodule:"Acceleration"},{file:"src/events/acceleration.js",line:346,description:"<p>The setMoveThreshold() function is used to set the movement threshold for\nthe deviceMoved() function. The default threshold is set to 0.5.</p>\n",itemtype:"method",name:"setMoveThreshold",params:[{name:"value",description:"<p>The threshold value</p>\n",type:"Number"}],class:"p5",module:"Events",submodule:"Acceleration"},{file:"src/events/acceleration.js",line:359,description:"<p>The setShakeThreshold() function is used to set the movement threshold for\nthe deviceShaken() function. The default threshold is set to 30.</p>\n",itemtype:"method",name:"setShakeThreshold",params:[{name:"value",description:"<p>The threshold value</p>\n",type:"Number"}],class:"p5",module:"Events",submodule:"Acceleration"},{file:"src/events/acceleration.js",line:372,description:"<p>The deviceMoved() function is called when the device is moved by more than\nthe threshold value along X, Y or Z axis. The default threshold is set to\n0.5.</p>\n",itemtype:"method",name:"deviceMoved",example:['\n<div class="norender">\n<code>\n// Run this example on a mobile device\n// Move the device around\n// to change the value.\n\nvar value = 0;\nfunction draw() {\n fill(value);\n rect(25, 25, 50, 50);\n}\nfunction deviceMoved() {\n value = value + 5;\n if (value > 255) {\n value = 0;\n }\n}\n</code>\n</div>'],alt:"50x50 black rect in center of canvas. turns white on mobile when device moves",class:"p5",module:"Events",submodule:"Acceleration"},{file:"src/events/acceleration.js",line:403,description:"<p>The deviceTurned() function is called when the device rotates by\nmore than 90 degrees continuously.\n<br><br>\nThe axis that triggers the deviceTurned() method is stored in the turnAxis\nvariable. The deviceTurned() method can be locked to trigger on any axis:\nX, Y or Z by comparing the turnAxis variable to 'X', 'Y' or 'Z'.</p>\n",itemtype:"method",name:"deviceTurned",example:["\n<div class=\"norender\">\n<code>\n// Run this example on a mobile device\n// Rotate the device by 90 degrees\n// to change the value.\n\nvar value = 0;\nfunction draw() {\n fill(value);\n rect(25, 25, 50, 50);\n}\nfunction deviceTurned() {\n if (value == 0){\n value = 255\n } else if (value == 255) {\n value = 0;\n }\n}\n</code>\n</div>\n<div>\n<code>\n// Run this example on a mobile device\n// Rotate the device by 90 degrees in the\n// X-axis to change the value.\n\nvar value = 0;\nfunction draw() {\n fill(value);\n rect(25, 25, 50, 50);\n}\nfunction deviceTurned() {\n if (turnAxis == 'X'){\n if (value == 0){\n value = 255\n } else if (value == 255) {\n value = 0;\n }\n }\n}\n</code>\n</div>"],alt:"50x50 black rect in center of canvas. turns white on mobile when device turns\n50x50 black rect in center of canvas. turns white on mobile when x-axis turns",class:"p5",module:"Events",submodule:"Acceleration"},{file:"src/events/acceleration.js",line:462,description:"<p>The deviceShaken() function is called when the device total acceleration\nchanges of accelerationX and accelerationY values is more than\nthe threshold value. The default threshold is set to 30.</p>\n",itemtype:"method",name:"deviceShaken",example:['\n<div class="norender">\n<code>\n// Run this example on a mobile device\n// Shake the device to change the value.\n\nvar value = 0;\nfunction draw() {\n fill(value);\n rect(25, 25, 50, 50);\n}\nfunction deviceShaken() {\n value = value + 5;\n if (value > 255) {\n value = 0;\n }\n}\n</code>\n</div>'],alt:"50x50 black rect in center of canvas. turns white on mobile when device shakes",class:"p5",module:"Events",submodule:"Acceleration"},{file:"src/events/keyboard.js",line:12,description:"<p>Holds the key codes of currently pressed keys.</p>\n",access:"private",tagname:"",class:"p5",module:"Events",submodule:"Keyboard"},{file:"src/events/keyboard.js",line:18,description:"<p>The boolean system variable keyIsPressed is true if any key is pressed\nand false if no keys are pressed.</p>\n",itemtype:"property",name:"keyIsPressed",type:"Boolean",readonly:"",example:["\n<div>\n<code>\nvar value = 0;\nfunction draw() {\n if (keyIsPressed === true) {\n fill(0);\n } else {\n fill(255);\n }\n rect(25, 25, 50, 50);\n}\n</code>\n</div>"],alt:"50x50 white rect that turns black on keypress.",class:"p5",module:"Events",submodule:"Keyboard"},{file:"src/events/keyboard.js",line:46,description:"<p>The system variable key always contains the value of the most recent\nkey on the keyboard that was typed. To get the proper capitalization, it\nis best to use it within keyTyped(). For non-ASCII keys, use the keyCode\nvariable.</p>\n",itemtype:"property",name:"key",type:"String",readonly:"",example:["\n<div><code>\n// Click any key to display it!\n// (Not Guaranteed to be Case Sensitive)\nfunction setup() {\n fill(245, 123, 158);\n textSize(50);\n}\n\nfunction draw() {\n background(200);\n text(key, 33,65); // Display last key pressed.\n}\n</div></code>"],alt:"canvas displays any key value that is pressed in pink font.",class:"p5",module:"Events",submodule:"Keyboard"},{file:"src/events/keyboard.js",line:75,description:'<p>The variable keyCode is used to detect special keys such as BACKSPACE,\nDELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, OPTION, ALT, UP_ARROW,\nDOWN_ARROW, LEFT_ARROW, RIGHT_ARROW.\nYou can also check for custom keys by looking up the keyCode of any key\non a site like this: <a href="http://keycode.info/">keycode.info</a>.</p>\n',itemtype:"property",name:"keyCode",type:"Number",readonly:"",example:["\n<div><code>\nvar fillVal = 126;\nfunction draw() {\n fill(fillVal);\n rect(25, 25, 50, 50);\n}\n\nfunction keyPressed() {\n if (keyCode == UP_ARROW) {\n fillVal = 255;\n } else if (keyCode == DOWN_ARROW) {\n fillVal = 0;\n }\n return false; // prevent default\n}\n</code></div>"],alt:"Grey rect center. turns white when up arrow pressed and black when down",class:"p5",module:"Events",submodule:"Keyboard"},{file:"src/events/keyboard.js",line:108,description:"<p>The keyPressed() function is called once every time a key is pressed. The\nkeyCode for the key that was pressed is stored in the keyCode variable.\n<br><br>\nFor non-ASCII keys, use the keyCode variable. You can check if the keyCode\nequals BACKSPACE, DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL,\nOPTION, ALT, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW.\n<br><br>\nFor ASCII keys that was pressed is stored in the key variable. However, it\ndoes not distinguish between uppercase and lowercase. For this reason, it\nis recommended to use keyTyped() to read the key variable, in which the\ncase of the variable will be distinguished.\n<br><br>\nBecause of how operating systems handle key repeats, holding down a key\nmay cause multiple calls to keyTyped() (and keyReleased() as well). The\nrate of repeat°äŒf +description:"<p>The touchEnded() function is called every time a touch ends. If no\ntouchEnded() function is defined, the mouseReleased() function will be\ncalled instead if it is defined.<br><br>\nBrowsers may have different default behaviors attached to various touch\nevents. To prevent any default behavior for this event, add "return false"\nto the end of the method.</p>\n",itemtype:"method",name:"touchEnded",example:['\n<div>\n<code>\n// Release touch within the image to\n// change the value of the rectangle\n\nvar value = 0;\nfunction draw() {\n fill(value);\n rect(25, 25, 50, 50);\n}\nfunction touchEnded() {\n if (value == 0) {\n value = 255;\n } else {\n value = 0;\n }\n}\n</code>\n</div>\n\n<div class="norender">\n<code>\nfunction touchEnded() {\n ellipse(mouseX, mouseY, 5, 5);\n // prevent default\n return false;\n}\n</code>\n</div>'],alt:"50x50 black rect turns white with touch.\nno image displayed",class:"p5",module:"Events",submodule:"Touch"},{file:"src/image/filters.js",line:3,description:'<p>This module defines the filters for use with image buffers.</p>\n<p>This module is basically a collection of functions stored in an object\nas opposed to modules. The functions are destructive, modifying\nthe passed in canvas rather than creating a copy.</p>\n<p>Generally speaking users of this module will use the Filters.apply method\non a canvas to create an effect.</p>\n<p>A number of functions are borrowed/adapted from\n<a href="http://www.html5rocks.com/en/tutorials/canvas/imagefilters/">http://www.html5rocks.com/en/tutorials/canvas/imagefilters/</a>\nor the java processing implementation.</p>\n',class:"p5",module:"Events"},{file:"src/image/filters.js",line:28,description:"<p>Returns the pixel buffer for a canvas</p>\n",access:"private",tagname:"",params:[{name:"canvas",description:"<p>the canvas to get pixels from</p>\n",type:"Canvas|ImageData"}],return:{description:"a one-dimensional array containing\n the data in thc RGBA order, with integer\n values between 0 and 255",type:"Uint8ClampedArray"},class:"p5",module:"Events"},{file:"src/image/filters.js",line:51,description:"<p>Returns a 32 bit number containing ARGB data at ith pixel in the\n1D array containing pixels data.</p>\n",access:"private",tagname:"",params:[{name:"data",description:"<p>array returned by _toPixels()</p>\n",type:"Uint8ClampedArray"},{name:"i",description:"<p>index of a 1D Image Array</p>\n",type:"Integer"}],return:{description:"32 bit integer value representing\n ARGB value.",type:"Integer"},class:"p5",module:"Events"},{file:"src/image/filters.js",line:70,description:"<p>Modifies pixels RGBA values to values contained in the data object.</p>\n",access:"private",tagname:"",params:[{name:"pixels",description:"<p>array returned by _toPixels()</p>\n",type:"Uint8ClampedArray"},{name:"data",description:"<p>source 1D array where each value\n represents ARGB values</p>\n",type:"Int32Array"}],class:"p5",module:"Events"},{file:"src/image/filters.js",line:90,description:'<p>Returns the ImageData object for a canvas\n<a href="https://developer.mozilla.org/en-US/docs/Web/API/ImageData">https://developer.mozilla.org/en-US/docs/Web/API/ImageData</a></p>\n',access:"private",tagname:"",params:[{name:"canvas",description:"<p>canvas to get image data from</p>\n",type:"Canvas|ImageData"}],return:{description:"Holder of pixel data (and width and\n height) for a canvas",type:"ImageData"},class:"p5",module:"Events"},{file:"src/image/filters.js",line:113,description:"<p>Returns a blank ImageData object.</p>\n",access:"private",tagname:"",params:[{name:"width",description:"",type:"Integer"},{name:"height",description:"",type:"Integer"}],return:{description:"",type:"ImageData"},class:"p5",module:"Events"},{file:"src/image/filters.js",line:129,description:"<p>Applys a filter function to a canvas.</p>\n<p>The difference between this and the actual filter functions defined below\nis that the filter functions generally modify the pixel buffer but do\nnot actually put that data back to the canvas (where it would actually\nupdate what is visible). By contrast this method does make the changes\nactually visible in the canvas.</p>\n<p>The apply method is the method that callers of this module would generally\nuse. It has been separated from the actual filters to support an advanced\nuse case of creating a filter chain that executes without actually updating\nthe canvas in between everystep.</p>\n",params:[{name:"canvas",description:"<p>[description]</p>\n",type:"HTMLCanvasElement"},{name:"func",description:"<p>[description]</p>\n",type:"Function(ImageData,Object)"},{name:"filterParam",description:"<p>[description]</p>\n",type:"Object"}],class:"p5",module:"Events"},{file:"src/image/filters.js",line:167,description:'<p>Converts the image to black and white pixels depending if they are above or\nbelow the threshold defined by the level parameter. The parameter must be\nbetween 0.0 (black) and 1.0 (white). If no level is specified, 0.5 is used.</p>\n<p>Borrowed from <a href="http://www.html5rocks.com/en/tutorials/canvas/imagefilters/">http://www.html5rocks.com/en/tutorials/canvas/imagefilters/</a></p>\n',params:[{name:"canvas",description:"",type:"Canvas"},{name:"level",description:"",type:"Float"}],class:"p5",module:"Events"},{file:"src/image/filters.js",line:202,description:'<p>Converts any colors in the image to grayscale equivalents.\nNo parameter is used.</p>\n<p>Borrowed from <a href="http://www.html5rocks.com/en/tutorials/canvas/imagefilters/">http://www.html5rocks.com/en/tutorials/canvas/imagefilters/</a></p>\n',params:[{name:"canvas",description:"",type:"Canvas"}],class:"p5",module:"Events"},{file:"src/image/filters.js",line:224,description:"<p>Sets the alpha channel to entirely opaque. No parameter is used.</p>\n",params:[{name:"canvas",description:"",type:"Canvas"}],class:"p5",module:"Events"},{file:"src/image/filters.js",line:239,description:"<p>Sets each pixel to its inverse value. No parameter is used.</p>\n",params:[{name:"canvas",description:"",type:"Canvas"}],class:"p5",module:"Events"},{file:"src/image/filters.js",line:255,description:"<p>Limits each channel of the image to the number of colors specified as\nthe parameter. The parameter can be set to values between 2 and 255, but\nresults are most noticeable in the lower ranges.</p>\n<p>Adapted from java based processing implementation</p>\n",params:[{name:"canvas",description:"",type:"Canvas"},{name:"level",description:"",type:"Integer"}],class:"p5",module:"Events"},{file:"src/image/filters.js",line:286,description:"<p>reduces the bright areas in an image</p>\n",params:[{name:"canvas",description:"",type:"Canvas"}],class:"p5",module:"Events"},{file:"src/image/filters.js",line:367,description:"<p>increases the bright areas in an image</p>\n",params:[{name:"canvas",description:"",type:"Canvas"}],class:"p5",module:"Events"},{file:"src/image/image.js",line:8,description:"<p>This module defines the p5 methods for the p5.Image class\nfor drawing images to the main display canvas.</p>\n",class:"p5",module:"Image",submodule:"Image"},{file:"src/image/image.js",line:24,description:"<p>Creates a new p5.Image (the datatype for storing images). This provides a\nfresh buffer of pixels to play with. Set the size of the buffer with the\nwidth and height parameters.\n<br><br>\n.pixels gives access to an array containing the values for all the pixels\nin the display window.\nThese values are numbers. This array is the size (including an appropriate\nfactor for the pixelDensity) of the display window x4,\nrepresenting the R, G, B, A values in order for each pixel, moving from\nleft to right across each row, then down each column. See .pixels for\nmore info. It may also be simpler to use set() or get().\n<br><br>\nBefore accessing the pixels of an image, the data must loaded with the\nloadPixels() function. After the array data has been modified, the\nupdatePixels() function must be run to update the changes.</p>\n",itemtype:"method",name:"createImage",params:[{name:"width",description:"<p>width in pixels</p>\n",type:"Integer"},{name:"height",description:"<p>height in pixels</p>\n",type:"Integer"}],return:{description:"the p5.Image object",type:"p5.Image"},example:["\n<div>\n<code>\nimg = createImage(66, 66);\nimg.loadPixels();\nfor (i = 0; i < img.width; i++) {\n for (j = 0; j < img.height; j++) {\n img.set(i, j, color(0, 90, 102));\n }\n}\nimg.updatePixels();\nimage(img, 17, 17);\n</code>\n</div>\n\n<div>\n<code>\nimg = createImage(66, 66);\nimg.loadPixels();\nfor (i = 0; i < img.width; i++) {\n for (j = 0; j < img.height; j++) {\n img.set(i, j, color(0, 90, 102, i % img.width * 2));\n }\n}\nimg.updatePixels();\nimage(img, 17, 17);\nimage(img, 34, 34);\n</code>\n</div>\n\n<div>\n<code>\nvar pink = color(255, 102, 204);\nimg = createImage(66, 66);\nimg.loadPixels();\nvar d = pixelDensity();\nvar halfImage = 4 * (width * d) * (height/2 °äŒf +alt:"image of rocky mountains with white at right\n\n\nhttp://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/",class:"p5.Image",module:"Image",submodule:"Image"},{file:"src/image/p5.Image.js",line:536,description:"<p>Applies an image filter to a p5.Image</p>\n",itemtype:"method",name:"filter",params:[{name:"operation",description:"<p>one of threshold, gray, invert, posterize, opaque\n erode, dilate and blur. See Filters.js for docs on\n each available filter</p>\n",type:"String"},{name:"value",description:"",type:"Number|undefined"}],example:['\n<div><code>\nvar photo1;\nvar photo2;\n\nfunction preload() {\n photo1 = loadImage("assets/rockies.jpg");\n photo2 = loadImage("assets/rockies.jpg");\n}\n\nfunction setup() {\n photo2.filter("gray");\n image(photo1, 0, 0);\n image(photo2, width/2, 0);\n}\n</code></div>'],alt:"2 images of rocky mountains left one in color, right in black and white",class:"p5.Image",module:"Image",submodule:"Image"},{file:"src/image/p5.Image.js",line:569,description:"<p>Copies a region of pixels from one image to another, using a specified\nblend mode to do the operation.</p>\n",itemtype:"method",name:"blend",params:[{name:"srcImage",description:"<p>source image</p>\n",type:"p5.Image|undefined"},{name:"sx",description:"<p>X coordinate of the source's upper left corner</p>\n",type:"Integer"},{name:"sy",description:"<p>Y coordinate of the source's upper left corner</p>\n",type:"Integer"},{name:"sw",description:"<p>source image width</p>\n",type:"Integer"},{name:"sh",description:"<p>source image height</p>\n",type:"Integer"},{name:"dx",description:"<p>X coordinate of the destination's upper left corner</p>\n",type:"Integer"},{name:"dy",description:"<p>Y coordinate of the destination's upper left corner</p>\n",type:"Integer"},{name:"dw",description:"<p>destination image width</p>\n",type:"Integer"},{name:"dh",description:"<p>destination image height</p>\n",type:"Integer"},{name:"blendMode",description:'<p>the blend mode</p>\n<p>Available blend modes are: normal | multiply | screen | overlay |\n darken | lighten | color-dodge | color-burn | hard-light |\n soft-light | difference | exclusion | hue | saturation |\n color | luminosity</p>\n<p><a href="http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/">http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/</a></p>\n',type:"Integer"}],example:['\n<div><code>\nvar mountains;\nvar bricks;\n\nfunction preload() {\n mountains = loadImage("assets/rockies.jpg");\n bricks = loadImage("assets/bricks_third.jpg");\n}\n\nfunction setup() {\n mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, ADD);\n image(mountains, 0, 0);\n image(bricks, 0, 0);\n}\n</code></div>\n<div><code>\nvar mountains;\nvar bricks;\n\nfunction preload() {\n mountains = loadImage("assets/rockies.jpg");\n bricks = loadImage("assets/bricks_third.jpg");\n}\n\nfunction setup() {\n mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST);\n image(mountains, 0, 0);\n image(bricks, 0, 0);\n}\n</code></div>\n<div><code>\nvar mountains;\nvar bricks;\n\nfunction preload() {\n mountains = loadImage("assets/rockies.jpg");\n bricks = loadImage("assets/bricks_third.jpg");\n}\n\nfunction setup() {\n mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST);\n image(mountains, 0, 0);\n image(bricks, 0, 0);\n}\n</code></div>'],alt:"image of rocky mountains. Brick images on left and right. Right overexposed\nimage of rockies. Brickwall images on left and right. Right mortar transparent\nimage of rockies. Brickwall images on left and right. Right translucent",class:"p5.Image",module:"Image",submodule:"Image"},{file:"src/image/p5.Image.js",line:649,description:"<p>Saves the image to a file and force the browser to download it.\nAccepts two strings for filename and file extension\nSupports png (default) and jpg.</p>\n",itemtype:"method",name:"save",params:[{name:"filename",description:"<p>give your file a name</p>\n",type:"String"},{name:"extension",description:"<p>'png' or 'jpg'</p>\n",type:"String"}],example:['\n<div><code>\nvar photo;\n\nfunction preload() {\n photo = loadImage("assets/rockies.jpg");\n}\n\nfunction draw() {\n image(photo, 0, 0);\n}\n\nfunction keyTyped() {\n if (key == \'s\') {\n photo.save("photo", "png");\n }\n}\n</code></div>'],alt:"image of rocky mountains.",class:"p5.Image",module:"Image",submodule:"Image"},{file:"src/image/pixels.js",line:14,description:"<p><a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference\n/Global_Objects/Uint8ClampedArray' target='_blank'>Uint8ClampedArray</a>\ncontaining the values for all the pixels in the display window.\nThese values are numbers. This array is the size (include an appropriate\nfactor for pixelDensity) of the display window x4,\nrepresenting the R, G, B, A values in order for each pixel, moving from\nleft to right across each row, then down each column. Retina and other\nhigh density displays will have more pixels[] (by a factor of\npixelDensity^2).\nFor example, if the image is 100x100 pixels, there will be 40,000. On a\nretina display, there will be 160,000.\n<br><br>\nThe first four values (indices 0-3) in the array will be the R, G, B, A\nvalues of the pixel at (0, 0). The second four values (indices 4-7) will\ncontain the R, G, B, A values of the pixel at (1, 0). More generally, to\nset values for a pixel at (x, y):</p>\n<pre><code class=\"lang-javascript\">var d = pixelDensity;\nfor (var i = 0; i < d; i++) {\n for (var j = 0; j < d; j++) {\n // loop over\n idx = 4 * ((y * d + j) * width * d + (x * d + i));\n pixels[idx] = r;\n pixels[idx+1] = g;\n pixels[idx+2] = b;\n pixels[idx+3] = a;\n }\n}\n</code></pre>\n<p>While the above method is complex, it is flexible enough to work with\nany pixelDensity. Note that set() will automatically take care of\nsetting all the appropriate values in pixels[] for a given (x, y) at\nany pixelDensity, but the performance may not be as fast when lots of\nmodifications are made to the pixel array.\n<br><br>\nBefore accessing this array, the data must loaded with the loadPixels()\nfunction. After the array data has been modified, the updatePixels()\nfunction must be run to update the changes.\n<br><br>\nNote that this is not a standard javascript array. This means that\nstandard javascript functions such as <code>slice()</code> or\n<code>arrayCopy()</code> do not\nwork.</p>",itemtype:"property",name:"pixels",type:"Number[]",example:["\n<div>\n<code>\nvar pink = color(255, 102, 204);\nloadPixels();\nvar d = pixelDensity();\nvar halfImage = 4 * (width * d) * (height/2 * d);\nfor (var i = 0; i < halfImage; i+=4) {\n pixels[i] = red(pink);\n pixels[i+1] = green(pink);\n pixels[i+2] = blue(pink);\n pixels[i+3] = alpha(pink);\n}\nupdatePixels();\n</code>\n</div>"],alt:"top half of canvas pink, bottom grey",class:"p5",module:"Image",submodule:"Pixels"},{file:"src/image/pixels.js",line:83,description:"<p>Copies a region of pixels from one image to another, using a specified\nblend mode to do the operation.<br><br>\nAvailable blend modes are: BLEND | DARKEST | LIGHTEST | DIFFERENCE |\nMULTIPLY| EXCLUSION | SCREEN | REPLACE | OVERLAY | HARD_LIGHT |\nSOFT_LIGHT | DODGE | BURN | ADD | NORMAL</p>\n",itemtype:"method",name:"blend",params:[{name:"srcImage",description:"<p>source image</p>\n",type:"p5.Image|undefined"},{name:"sx",description:"<p>X coordinate of the source's upper left corner</p>\n",type:"Integer"},{name:"sy",description:"<p>Y coordinate of the source's upper left corner</p>\n",type:"Integer"},{name:"sw",description:"<p>source image width</p>\n",type:"Integer"},{name:"sh",description:"<p>source image height</p>\n",type:"Integer"},{name:"dx",description:"<p>X coordinate of the destination's upper left corner</p>\n",type:"Integer"},{name:"dy",description:"<p>Y coordinate of the destination's upper left corner</p>\n",type:"Integer"},{name:"dw",description:"<p>destination image width</p>\n",type:"Integer"},{name:"dh",description:"<p>destination image height</p>\n",type:"Integer"},{name:"blendMode",description:"<p>the blend mode</p>\n",type:"Integer"}],example:['\n<div><code>\nvar img0;\nvar img1;\n\nfunction preload() {\n img0 = loadImage("assets/rockies.jpg");\n img1 = loadImage("assets/bricks_third.jpg");\n}\n\nfunction setup() {\n background(img0);\n image(img1, 0, 0);\n blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST);\n}\n</code></div>\n<div><code>\nvar img0;\nvar img1;\n\nfunction preload() {\n img0 = loadImage("assets/rockies.jpg");\n img1 = loadImage("assets/bricks_third.jpg");\n}\n\nfunction setup() {\n background(img0);\n image(img1, 0, 0);\n blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST);\n}\n</code></div>\n<div><code>\nvar img0;\nvar img1;\n\nfunction preload() {\n img0 = loadImage("assets/rockies.jpg");\n img1 = loadImage("assets/bricks_third.jpg");\n}\n\nfunction setup() {\n background(img0);\n image(img1, 0, 0);\n blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, ADD);\n}\n</code></div>'],alt:"image of rocky mountains. Brick images on left and right. Right overexposed\nimage of rockies. Brickwall images on left and right. Right mortar transparent\nimage of rockies. Brickwall images on left and right. Right translucent",class:"p5",module:"Image",submodule:"Pixels"},{file:"src/image/pixels.js",line:165,description:"<p>Copies a region of the canvas to another region of the canvas\nand copies a region of pixels from an image used as the srcImg parameter\ninto the canvas srcImage is specified this is used as the source. If\nthe source and destination regions aren't the same size, it will\nautomatically resize source pixels to fit the specified\ntarget region.</p>\n",itemtype:"method",name:"copy",params:[{name:"srcImage",description:"<p>source image</p>\n",type:"p5.Image|undefi°äŒf +example:['\n<div class=\'norender\'><code>\n// The following short XML file called "mammals.xml" is parsed\n// in the code below.\n//\n// <?xml version="1.0"?>\n// <mammals>\n// <animal id="0" species="Capra hircus">Goat</animal>\n// <animal id="1" species="Panthera pardus">Leopard</animal>\n// <animal id="2" species="Equus zebra">Zebra</animal>\n// </mammals>\n\nvar xml;\n\nfunction preload() {\n xml = loadXML("assets/mammals.xml");\n}\n\nfunction setup() {\n var children = xml.getChildren("animal");\n\n for (var i = 0; i < children.length; i++) {\n var id = children[i].getNum("id");\n var coloring = children[i].getString("species");\n var name = children[i].getContent();\n print(id + ", " + coloring + ", " + name);\n }\n}\n\n// Sketch prints:\n// 0, Capra hircus, Goat\n// 1, Panthera pardus, Leopard\n// 2, Equus zebra, Zebra\n</code></div>'],alt:"no image displayed",class:"p5",module:"IO",submodule:"Input"},{file:"src/io/files.js",line:649,description:"<p>Method for executing an HTTP GET request. If data type is not specified,\np5 will try to guess based on the URL, defaulting to text. This is equivalent to\ncalling <code>httpDo(path, 'GET')</code>.</p>\n",itemtype:"method",name:"httpGet",params:[{name:"path",description:"<p>name of the file or url to load</p>\n",type:"String"},{name:"datatype",description:"<p>"json", "jsonp", "xml", or "text"</p>\n",type:"String",optional:!0},{name:"data",description:"<p>param data passed sent with request</p>\n",type:"Object",optional:!0},{name:"callback",description:"<p>function to be executed after\n httpGet() completes, data is passed in\n as first argument</p>\n",type:"Function",optional:!0},{name:"errorCallback",description:"<p>function to be executed if\n there is an error, response is passed\n in as first argument</p>\n",type:"Function",optional:!0}],example:["\n<div class='norender'><code>\n // Examples use USGS Earthquake API:\n // https://earthquake.usgs.gov/fdsnws/event/1/#methods\n var earthquakes;\n function preload() {\n // Get the most recent earthquake in the database\n var url = 'https://earthquake.usgs.gov/fdsnws/event/1/query?' +\n 'format=geojson&limit=1&orderby=time';\n httpGet(url, \"jsonp\", false, function(response) {\n // when the HTTP request completes, populate the variable that holds the\n // earthquake data used in the visualization.\n earthquakes = response;\n });\n }\n\n function draw() {\n if (!earthquakes) {\n // Wait until the earthquake data has loaded before drawing.\n return\n }\n background(200);\n // Get the magnitude and name of the earthquake out of the loaded JSON\n var earthquakeMag = earthquakes.features[0].properties.mag;\n var earthquakeName = earthquakes.features[0].properties.place;\n ellipse(width/2, height/2, earthquakeMag * 10, earthquakeMag * 10);\n textAlign(CENTER);\n text(earthquakeName, 0, height - 30, width, 30);\n noLoop();\n }\n</code></div>"],class:"p5",module:"IO",submodule:"Input"},{file:"src/io/files.js",line:702,description:"<p>Method for executing an HTTP POST request. If data type is not specified,\np5 will try to guess based on the URL, defaulting to text. This is equivalent to\ncalling <code>httpDo(path, 'POST')</code>.</p>\n",itemtype:"method",name:"httpPost",params:[{name:"path",description:"<p>name of the file or url to load</p>\n",type:"String"},{name:"datatype",description:"<p>"json", "jsonp", "xml", or "text"</p>\n",type:"String",optional:!0},{name:"data",description:"<p>param data passed sent with request</p>\n",type:"Object",optional:!0},{name:"callback",description:"<p>function to be executed after\n httpGet() completes, data is passed in\n as first argument</p>\n",type:"Function",optional:!0},{name:"errorCallback",description:"<p>function to be executed if\n there is an error, response is passed\n in as first argument</p>\n",type:"Function",optional:!0}],class:"p5",module:"IO",submodule:"Input"},{file:"src/io/files.js",line:724,description:"<p>Method for executing an HTTP request. If data type is not specified,\np5 will try to guess based on the URL, defaulting to text.<br><br>\nFor more advanced use, you may also pass in the path as the first argument\nand a object as the second argument, the signature follows the one specified\nin the Fetch API specification.</p>\n",itemtype:"method",name:"httpDo",class:"p5",module:"IO",submodule:"Input",overloads:[{line:724,params:[{name:"path",description:"<p>name of the file or url to load</p>\n",type:"String"},{name:"method",description:"<p>either "GET", "POST", or "PUT",\n defaults to "GET"</p>\n",type:"String",optional:!0},{name:"datatype",description:"<p>"json", "jsonp", "xml", or "text"</p>\n",type:"String",optional:!0},{name:"data",description:"<p>param data passed sent with request</p>\n",type:"Object",optional:!0},{name:"callback",description:"<p>function to be executed after\n httpGet() completes, data is passed in\n as first argument</p>\n",type:"Function",optional:!0},{name:"errorCallback",description:"<p>function to be executed if\n there is an error, response is passed\n in as first argument</p>\n",type:"Function",optional:!0}]},{line:745,params:[{name:"path",description:"",type:"String"},{name:"options",description:'<p>Request object options as documented in the\n "fetch" API\n<a href="https://developer.mozilla.org/en/docs/Web/API/Fetch_API">reference</a></p>\n',type:"Object"},{name:"callback",description:"",type:"Function",optional:!0},{name:"errorCallback",description:"",type:"Function",optional:!0}]}]},{file:"src/io/files.js",line:957,description:"<p>Save an image, text, json, csv, wav, or html. Prompts download to\nthe client's computer. <b>Note that it is not recommended to call save()\nwithin draw if it's looping, as the save() function will open a new save\ndialog every frame.</b></p>\n<p>The default behavior is to save the canvas as an image. You can\noptionally specify a filename.\nFor example:</p>\n<pre class='language-javascript'><code>\nsave();\nsave('myCanvas.jpg'); // save a specific canvas with a filename\n</code></pre>\n\n<p>Alternately, the first parameter can be a pointer to a canvas\np5.Element, an Array of Strings,\nan Array of JSON, a JSON object, a p5.Table, a p5.Image, or a\np5.SoundFile (requires p5.sound). The second parameter is a filename\n(including extension). The third parameter is for options specific\nto this type of object. This method will save a file that fits the\ngiven paramaters. For example:</p>\n\n<pre class='language-javascript'><code>\n\nsave('myCanvas.jpg'); // Saves canvas as an image\n\nvar cnv = createCanvas(100, 100);\nsave(cnv, 'myCanvas.jpg'); // Saves canvas as an image\n\nvar gb = createGraphics(100, 100);\nsave(gb, 'myGraphics.jpg'); // Saves p5.Renderer object as an image\n\nsave(myTable, 'myTable.html'); // Saves table as html file\nsave(myTable, 'myTable.csv',); // Comma Separated Values\nsave(myTable, 'myTable.tsv'); // Tab Separated Values\n\nsave(myJSON, 'my.json'); // Saves pretty JSON\nsave(myJSON, 'my.json', true); // Optimizes JSON filesize\n\nsave(img, 'my.png'); // Saves pImage as a png image\n\nsave(arrayOfStrings, 'my.txt'); // Saves strings to a text file with line\n // breaks after each item in the array\n</code></pre>",itemtype:"method",name:"save",params:[{name:"objectOrFilename",description:"<p>If filename is provided, will\n save canvas as an image with\n either png or jpg extension\n depending on the filename.\n If object is provided, will\n save depending on the object\n and filename (see examples\n above).</p>\n",type:"Object|String",optional:!0},{name:"filename",description:"<p>If an object is provided as the first\n parameter, then the second parameter\n indicates the filename,\n and should include an appropriate\n file extension (see examples above).</p>\n",type:"String",optional:!0},{name:"options",description:"<p>Additional options depend on\n filetype. For example, when saving JSON,\n <code>true</code> indicates that the\n output will be optimized for filesize,\n rather than readability.</p>\n",type:"Boolean|String",optional:!0}],class:"p5",module:"IO",submodule:"Output"},{file:"src/io/files.js",line:1074,description:"<p>Writes the contents of an Array or a JSON object to a .json file.\nThe file saving process and location of the saved file will\nvary between web browsers.</p>\n",itemtype:"method",name:"saveJSON",params:[{name:"json",description:"",type:"Array|Object"},{name:"filename",description:"",type:"String"},{name:"optimize",description:"<p>If true, removes line breaks\n and spaces from the output\n file to optimize filesize\n (but not readability).</p>\n",type:"Boolean",optional:!0}],example:['\n<div><code>\nvar json;\n\nfunction setup() {\n\n json = {}; // new JSON Object\n\n json.id = 0;\n json.species = \'Panthera leo\';\n json.name = \'Lion\';\n\n// To save, un-comment the line below, then click \'run\'\n// saveJSON(json, \'lion.json\');\n}\n\n// Saves the following to a file called "lion.json":\n// {\n// "id": 0,\n// "species": "Panthera leo",\n// "name": "Lion"\n// }\n</div></code>'],alt:"no image displayed",class:"p5",module:"IO",submodule:"Output"},{file:"src/io/files.js",line:1128,description:"<p>Writes an array of Strings to a text file, one line per String.\nThe file saving process and location of the saved file will\nvary between web browsers.</p>\n",itemtype:"method",name:"saveStrings",params:[{name:"list",description:"<p>string array to be written</p>\n",type:"Array"},{name:"filename",description:"<p>filename for output</p>\n",type:"String"}],example:["\n<div><code>\nvar words = 'apple bear cat dog';\n\n// .split() outputs an Array\nvar list = split(words, ' ');\n\n// To save the file, un-comment next line and click 'run'\n// saveStrings(list, 'nouns.txt');\n\n/°äŒf +example:['\n<div class="norender">\n<code>\n// Given the CSV file "mammals.csv"\n// in the project\'s "assets" folder:\n//\n// id,species,name\n// 0,Capra hircus,Goat\n// 1,Panthera pardus,Leopard\n// 2,Equus zebra,Zebra\n\nvar table;\n\nfunction preload() {\n //my table is comma separated value "csv"\n //and has a header specifying the columns labels\n table = loadTable("assets/mammals.csv", "csv", "header");\n}\n\nfunction setup() {\n table.set(0, "species", "Canis Lupus");\n table.set(0, "name", "Wolf");\n\n //print the results\n for (var r = 0; r < table.getRowCount(); r++)\n for (var c = 0; c < table.getColumnCount(); c++)\n print(table.getString(r, c));\n}\n</code>\n</div>'],alt:"no image displayed",class:"p5.Table",module:"IO",submodule:"Table"},{file:"src/io/p5.Table.js",line:875,description:"<p>Stores a Float value in the Table's specified row and column.\nThe row is specified by its ID, while the column may be specified\nby either its ID or title.</p>\n",itemtype:"method",name:"setNum",params:[{name:"row",description:"<p>row ID</p>\n",type:"Number"},{name:"column",description:"<p>column ID (Number)\n or title (String)</p>\n",type:"String|Number"},{name:"value",description:"<p>value to assign</p>\n",type:"Number"}],example:['\n<div class="norender">\n<code>\n// Given the CSV file "mammals.csv"\n// in the project\'s "assets" folder:\n//\n// id,species,name\n// 0,Capra hircus,Goat\n// 1,Panthera pardus,Leopard\n// 2,Equus zebra,Zebra\n\nvar table;\n\nfunction preload() {\n //my table is comma separated value "csv"\n //and has a header specifying the columns labels\n table = loadTable("assets/mammals.csv", "csv", "header");\n}\n\nfunction setup() {\n table.setNum(1, "id", 1);\n\n print(table.getColumn(0));\n //["0", 1, "2"]\n}\n</code>\n</div>'],alt:"no image displayed",class:"p5.Table",module:"IO",submodule:"Table"},{file:"src/io/p5.Table.js",line:922,description:"<p>Stores a String value in the Table's specified row and column.\nThe row is specified by its ID, while the column may be specified\nby either its ID or title.</p>\n",itemtype:"method",name:"setString",params:[{name:"row",description:"<p>row ID</p>\n",type:"Number"},{name:"column",description:"<p>column ID (Number)\n or title (String)</p>\n",type:"String|Number"},{name:"value",description:"<p>value to assign</p>\n",type:"String"}],class:"p5.Table",module:"IO",submodule:"Table"},{file:"src/io/p5.Table.js",line:937,description:"<p>Retrieves a value from the Table's specified row and column.\nThe row is specified by its ID, while the column may be specified by\neither its ID or title.</p>\n",itemtype:"method",name:"get",params:[{name:"row",description:"<p>row ID</p>\n",type:"Number"},{name:"column",description:"<p>columnName (string) or\n ID (number)</p>\n",type:"String|Number"}],return:{description:"",type:"String|Number"},example:['\n<div class="norender">\n<code>\n// Given the CSV file "mammals.csv"\n// in the project\'s "assets" folder:\n//\n// id,species,name\n// 0,Capra hircus,Goat\n// 1,Panthera pardus,Leopard\n// 2,Equus zebra,Zebra\n\nvar table;\n\nfunction preload() {\n //my table is comma separated value "csv"\n //and has a header specifying the columns labels\n table = loadTable("assets/mammals.csv", "csv", "header");\n}\n\nfunction setup() {\n print(table.get(0, 1));\n //Capra hircus\n print(table.get(0, "species"));\n //Capra hircus\n}\n</code>\n</div>'],alt:"no image displayed",class:"p5.Table",module:"IO",submodule:"Table"},{file:"src/io/p5.Table.js",line:984,description:"<p>Retrieves a Float value from the Table's specified row and column.\nThe row is specified by its ID, while the column may be specified by\neither its ID or title.</p>\n",itemtype:"method",name:"getNum",params:[{name:"row",description:"<p>row ID</p>\n",type:"Number"},{name:"column",description:"<p>columnName (string) or\n ID (number)</p>\n",type:"String|Number"}],return:{description:"",type:"Number"},example:['\n<div class="norender">\n<code>\n// Given the CSV file "mammals.csv"\n// in the project\'s "assets" folder:\n//\n// id,species,name\n// 0,Capra hircus,Goat\n// 1,Panthera pardus,Leopard\n// 2,Equus zebra,Zebra\n\nvar table;\n\nfunction preload() {\n //my table is comma separated value "csv"\n //and has a header specifying the columns labels\n table = loadTable("assets/mammals.csv", "csv", "header");\n}\n\nfunction setup() {\n print(table.getNum(1, 0) + 100);\n //id 1 + 100 = 101\n}\n</code>\n</div>'],alt:"no image displayed",class:"p5.Table",module:"IO",submodule:"Table"},{file:"src/io/p5.Table.js",line:1029,description:"<p>Retrieves a String value from the Table's specified row and column.\nThe row is specified by its ID, while the column may be specified by\neither its ID or title.</p>\n",itemtype:"method",name:"getString",params:[{name:"row",description:"<p>row ID</p>\n",type:"Number"},{name:"column",description:"<p>columnName (string) or\n ID (number)</p>\n",type:"String|Number"}],return:{description:"",type:"String"},example:['\n<div class="norender">\n<code>\n// Given the CSV file "mammals.csv"\n// in the project\'s "assets" folder:\n//\n// id,species,name\n// 0,Capra hircus,Goat\n// 1,Panthera pardus,Leopard\n// 2,Equus zebra,Zebra\n\nvar table;\n\nfunction preload() {\n //my table is comma separated value "csv"\n //and has a header specifying the columns labels\n table = loadTable("assets/mammals.csv", "csv", "header");\n}\n\nfunction setup() {\n var tableArray = table.getArray();\n\n //output each row as array\n for (var i = 0; i < tableArray.length; i++)\n print(tableArray[i]);\n}\n</code>\n</div>'],alt:"no image displayed",class:"p5.Table",module:"IO",submodule:"Table"},{file:"src/io/p5.Table.js",line:1077,description:"<p>Retrieves all table data and returns as an object. If a column name is\npassed in, each row object will be stored with that attribute as its\ntitle.</p>\n",itemtype:"method",name:"getObject",params:[{name:"headerColumn",description:"<p>Name of the column which should be used to\n title each row object (optional)</p>\n",type:"String"}],return:{description:"",type:"Object"},example:['\n<div class="norender">\n<code>\n// Given the CSV file "mammals.csv"\n// in the project\'s "assets" folder:\n//\n// id,species,name\n// 0,Capra hircus,Goat\n// 1,Panthera pardus,Leopard\n// 2,Equus zebra,Zebra\n\nvar table;\n\nfunction preload() {\n //my table is comma separated value "csv"\n //and has a header specifying the columns labels\n table = loadTable("assets/mammals.csv", "csv", "header");\n}\n\nfunction setup() {\n var tableObject = table.getObject();\n\n print(tableObject);\n //outputs an object\n}\n</code>\n</div>'],alt:"no image displayed",class:"p5.Table",module:"IO",submodule:"Table"},{file:"src/io/p5.Table.js",line:1141,description:"<p>Retrieves all table data and returns it as a multidimensional array.</p>\n",itemtype:"method",name:"getArray",return:{description:"",type:"Array"},class:"p5.Table",module:"IO",submodule:"Table"},{file:"src/io/p5.TableRow.js",line:43,description:"<p>Stores a value in the TableRow's specified column.\nThe column may be specified by either its ID or title.</p>\n",itemtype:"method",name:"set",params:[{name:"column",description:"<p>Column ID (Number)\n or Title (String)</p>\n",type:"String|Number"},{name:"value",description:"<p>The value to be stored</p>\n",type:"String|Number"}],class:"p5.TableRow",module:"IO",submodule:"Table"},{file:"src/io/p5.TableRow.js",line:79,description:"<p>Stores a Float value in the TableRow's specified column.\nThe column may be specified by either its ID or title.</p>\n",itemtype:"method",name:"setNum",params:[{name:"column",description:"<p>Column ID (Number)\n or Title (String)</p>\n",type:"String|Number"},{name:"value",description:"<p>The value to be stored\n as a Float</p>\n",type:"Number"}],class:"p5.TableRow",module:"IO",submodule:"Table"},{file:"src/io/p5.TableRow.js",line:95,description:"<p>Stores a String value in the TableRow's specified column.\nThe column may be specified by either its ID or title.</p>\n",itemtype:"method",name:"setString",params:[{name:"column",description:"<p>Column ID (Number)\n or Title (String)</p>\n",type:"String|Number"},{name:"value",description:"<p>The value to be stored\n as a String</p>\n",type:"String"}],class:"p5.TableRow",module:"IO",submodule:"Table"},{file:"src/io/p5.TableRow.js",line:110,description:"<p>Retrieves a value from the TableRow's specified column.\nThe column may be specified by either its ID or title.</p>\n",itemtype:"method",name:"get",params:[{name:"column",description:"<p>columnName (string) or\n ID (number)</p>\n",type:"String|Number"}],return:{description:"",type:"String|Number"},class:"p5.TableRow",module:"IO",submodule:"Table"},{file:"src/io/p5.TableRow.js",line:127,description:"<p>Retrieves a Float value from the TableRow's specified\ncolumn. The column may be specified by either its ID or\ntitle.</p>\n",itemtype:"method",name:"getNum",params:[{name:"column",description:"<p>columnName (string) or\n ID (number)</p>\n",type:"String|Number"}],return:{description:"Float Floating point number",type:"Number"},class:"p5.TableRow",module:"IO",submodule:"Table"},{file:"src/io/p5.TableRow.js",line:151,description:"<p>Retrieves an String value from the TableRow's specified\ncolumn. The column may be specified by either its ID or\ntitle.</p>\n",itemtype:"method",name:"getString",params:[{name:"column",description:"<p>columnName (string) or\n ID (number)</p>\n",type:"String|Number"}],return:{description:"String",type:"String"},class:"p5.TableRow",module:"IO",submodule:"Table"},{file:"src/io/p5.XML.js",line:66,description:"<p>Gets a copy of the element's parent. Returns the parent as another\np5.XML object.</p>\n",itemtype:"method",name:"getParent",return:{description:"element parent",type:"p5.XML"},example:['\n<div class=\'norender\'><code>\n// The following short XML file called "mammals.xml" is parsed\n// in the code below.\n//\n// <?xml version="1.0"?>\n// <mammals>\n// <animal id="0" species="Capra hircus">Goat</animal>\n// <animal id="1" species="Panthera pardus">Leopard</animal>\n// <animal id="2" species="Equus zebra">Zebra</animal>\n// </mammals>\n\nvar xml;\n\nfunction preload() {\n xml = loadXML("assets/mammals.xml");\n}\n\nfunction setup() {\n var children = xml.getChildren("animal");\n var parent = children[1].getParent();\n print(parent.getName());\n}\n\n// Sketch prints:\n// mammals\n</code></div>'],class:"p5.XML",module:"IO",submodule:"XML"},{file:"src/io/p5.XML.js",line:104,description:"<p>Gets the element's full name, which is returned as a String.</p>\n",itemtype:"method",name:"getName",return:{description:"the name of the node",type:"String"},example:['<animal\n <div class=\'norender\'><code>\n // The following short XML file called "mammals.xml" is parsed\n // in the code below.\n //\n // <?xml version="1.0"?>\n // <mammals>\n // <animal id="0" species="Capra hircus">Goat</animal>\n // <animal id="1" species="Panthera pardus">Leopard</animal>\n // <animal id="2" species="Equus zebra">Zebra</animal>\n // </mammals>\n\n var xml;\n\n function preload() {\n xml = loadXML("assets/mammals.xml");\n }\n\n function setup() {\n print(xml.getName());\n }\n\n // Sketch prints:\n // mammals\n </code></div>'],class:"p5.XML",module:"IO",submodule:"XML"},{file:"src/io/p5.XML.js",line:139,description:"<p>Sets the element's name, which is specified a°äŒf +type:"Number"},{name:"y2",description:"<p>y-coordinate of the second point</p>\n",type:"Number"}],return:{description:"distance between the two points",type:"Number"}},{line:130,params:[{name:"x1",description:"",type:"Number"},{name:"y1",description:"",type:"Number"},{name:"z1",description:"<p>z-coordinate of the first point</p>\n",type:"Number"},{name:"x2",description:"",type:"Number"},{name:"y2",description:"",type:"Number"},{name:"z2",description:"<p>z-coordinate of the second point</p>\n",type:"Number"}],return:{description:"distance between the two points",type:"Number"}}]},{file:"src/math/calculation.js",line:183,description:"<p>Returns Euler's number e (2.71828...) raised to the power of the n\nparameter. Maps to Math.exp().</p>\n",itemtype:"method",name:"exp",params:[{name:"n",description:"<p>exponent to raise</p>\n",type:"Number"}],return:{description:"e^n",type:"Number"},example:['\n<div><code>\nfunction draw() {\n background(200);\n\n // Compute the exp() function with a value between 0 and 2\n var xValue = map(mouseX, 0, width, 0, 2);\n var yValue = exp(xValue);\n\n var y = map(yValue, 0, 8, height, 0);\n\n var legend = "exp (" + nfc(xValue, 3) +")\\n= " + nf(yValue, 1, 4);\n stroke(150);\n line(mouseX, y, mouseX, height);\n fill(0);\n text(legend, 5, 15);\n noStroke();\n ellipse (mouseX,y, 7, 7);\n\n // Draw the exp(x) curve,\n // over the domain of x from 0 to 2\n noFill();\n stroke(0);\n beginShape();\n for (var x = 0; x < width; x++) {\n xValue = map(x, 0, width, 0, 2);\n yValue = exp(xValue);\n y = map(yValue, 0, 8, height, 0);\n vertex(x, y);\n }\n\n endShape();\n line(0, 0, 0, height);\n line(0, height-1, width, height-1);\n}\n</code></div>'],alt:"ellipse moves along a curve with mouse x. e^n displayed.",class:"p5",module:"Math",submodule:"Calculation"},{file:"src/math/calculation.js",line:233,description:"<p>Calculates the closest int value that is less than or equal to the\nvalue of the parameter. Maps to Math.floor().</p>\n",itemtype:"method",name:"floor",params:[{name:"n",description:"<p>number to round down</p>\n",type:"Number"}],return:{description:"rounded down number",type:"Number"},example:["\n<div><code>\nfunction draw() {\n background(200);\n //map, mouseX between 0 and 5.\n var ax = map(mouseX, 0, 100, 0, 5);\n var ay = 66;\n\n //Get the floor of the mapped number.\n var bx = floor(map(mouseX, 0, 100, 0,5));\n var by = 33;\n\n // Multiply the mapped numbers by 20 to more easily\n // see the changes.\n stroke(0);\n fill(0);\n line(0, ay, ax * 20, ay);\n line(0, by, bx * 20, by);\n\n // Reformat the float returned by map and draw it.\n noStroke();\n text(nfc(ax, 2,2), ax, ay - 5);\n text(nfc(bx,1,1), bx, by - 5);\n}\n</code></div>"],alt:"2 horizontal lines & number sets. increase with mouse x. bottom to 2 decimals",class:"p5",module:"Math",submodule:"Calculation"},{file:"src/math/calculation.js",line:272,description:"<p>Calculates a number between two numbers at a specific increment. The amt\nparameter is the amount to interpolate between the two values where 0.0\nequal to the first point, 0.1 is very near the first point, 0.5 is\nhalf-way in between, etc. The lerp function is convenient for creating\nmotion along a straight path and for drawing dotted lines.</p>\n",itemtype:"method",name:"lerp",params:[{name:"start",description:"<p>first value</p>\n",type:"Number"},{name:"stop",description:"<p>second value</p>\n",type:"Number"},{name:"amt",description:"<p>number between 0.0 and 1.0</p>\n",type:"Number"}],return:{description:"lerped value",type:"Number"},example:["\n<div><code>\nfunction setup() {\n background(200);\n var a = 20;\n var b = 80;\n var c = lerp(a,b, .2);\n var d = lerp(a,b, .5);\n var e = lerp(a,b, .8);\n\n var y = 50\n\n strokeWeight(5);\n stroke(0); // Draw the original points in black\n point(a, y);\n point(b, y);\n\n stroke(100); // Draw the lerp points in gray\n point(c, y);\n point(d, y);\n point(e, y);\n}\n</code></div>"],alt:"5 points horizontally staggered mid-canvas. mid 3 are grey, outer black",class:"p5",module:"Math",submodule:"Calculation"},{file:"src/math/calculation.js",line:316,description:"<p>Calculates the natural logarithm (the base-e logarithm) of a number. This\nfunction expects the n parameter to be a value greater than 0.0. Maps to\nMath.log().</p>\n",itemtype:"method",name:"log",params:[{name:"n",description:"<p>number greater than 0</p>\n",type:"Number"}],return:{description:"natural logarithm of n",type:"Number"},example:['\n<div><code>\nfunction draw() {\n background(200);\n var maxX = 2.8;\n var maxY = 1.5;\n\n // Compute the natural log of a value between 0 and maxX\n var xValue = map(mouseX, 0, width, 0, maxX);\n if (xValue > 0) { // Cannot take the log of a negative number.\n var yValue = log(xValue);\n var y = map(yValue, -maxY, maxY, height, 0);\n\n // Display the calculation occurring.\n var legend = "log(" + nf(xValue, 1, 2) + ")\\n= " + nf(yValue, 1, 3);\n stroke(150);\n line(mouseX, y, mouseX, height);\n fill(0);\n text (legend, 5, 15);\n noStroke();\n ellipse (mouseX, y, 7, 7);\n }\n\n // Draw the log(x) curve,\n // over the domain of x from 0 to maxX\n noFill();\n stroke(0);\n beginShape();\n for(var x=0; x < width; x++) {\n xValue = map(x, 0, width, 0, maxX);\n yValue = log(xValue);\n y = map(yValue, -maxY, maxY, height, 0);\n vertex(x, y);\n }\n endShape();\n line(0,0,0,height);\n line(0,height/2,width, height/2);\n}\n</code></div>'],alt:"ellipse moves along a curve with mouse x. natural logarithm of n displayed.",class:"p5",module:"Math",submodule:"Calculation"},{file:"src/math/calculation.js",line:370,description:"<p>Calculates the magnitude (or length) of a vector. A vector is a direction\nin space commonly used in computer graphics and linear algebra. Because it\nhas no "start" position, the magnitude of a vector can be thought of as\nthe distance from the coordinate 0,0 to its x,y value. Therefore, mag() is\na shortcut for writing dist(0, 0, x, y).</p>\n",itemtype:"method",name:"mag",params:[{name:"a",description:"<p>first value</p>\n",type:"Number"},{name:"b",description:"<p>second value</p>\n",type:"Number"}],return:{description:"magnitude of vector from (0,0) to (a,b)",type:"Number"},example:['\n<div><code>\nfunction setup() {\n var x1 = 20;\n var x2 = 80;\n var y1 = 30;\n var y2 = 70;\n\n line(0, 0, x1, y1);\n print(mag(x1, y1)); // Prints "36.05551275463989"\n line(0, 0, x2, y1);\n print(mag(x2, y1)); // Prints "85.44003745317531"\n line(0, 0, x1, y2);\n print(mag(x1, y2)); // Prints "72.80109889280519"\n line(0, 0, x2, y2);\n print(mag(x2, y2)); // Prints "106.3014581273465"\n}\n</code></div>'],alt:"4 lines of different length radiate from top left of canvas.",class:"p5",module:"Math",submodule:"Calculation"},{file:"src/math/calculation.js",line:408,description:"<p>Re-maps a number from one range to another.\n<br><br>\nIn the first example above, the number 25 is converted from a value in the\nrange of 0 to 100 into a value that ranges from the left edge of the\nwindow (0) to the right edge (width).</p>\n",itemtype:"method",name:"map",params:[{name:"value",description:"<p>the incoming value to be converted</p>\n",type:"Number"},{name:"start1",description:"<p>lower bound of the value's current range</p>\n",type:"Number"},{name:"stop1",description:"<p>upper bound of the value's current range</p>\n",type:"Number"},{name:"start2",description:"<p>lower bound of the value's target range</p>\n",type:"Number"},{name:"stop2",description:"<p>upper bound of the value's target range</p>\n",type:"Number"}],return:{description:"remapped number",type:"Number"},example:["\n <div><code>\n var value = 25;\n var m = map(value, 0, 100, 0, width);\n ellipse(m, 50, 10, 10);\n </code></div>\n\n <div><code>\n function setup() {\n noStroke();\n }\n\n function draw() {\n background(204);\n var x1 = map(mouseX, 0, width, 25, 75);\n ellipse(x1, 25, 25, 25);\n var x2 = map(mouseX, 0, width, 0, 100);\n ellipse(x2, 75, 25, 25);\n }\n </code></div>"],alt:"10 by 10 white ellipse with in mid left canvas\n2 25 by 25 white ellipses move with mouse x. Bottom has more range from X",class:"p5",module:"Math",submodule:"Calculation"},{file:"src/math/calculation.js",line:452,description:"<p>Determines the largest value in a sequence of numbers, and then returns\nthat value. max() accepts any number of Number parameters, or an Array\nof any length.</p>\n",itemtype:"method",name:"max",params:[{name:"n0",description:"<p>Numbers to compare</p>\n",type:"Number|Array"}],return:{description:"maximum Number",type:"Number"},example:['\n<div><code>\nfunction setup() {\n // Change the elements in the array and run the sketch\n // to show how max() works!\n numArray = new Array(2,1,5,4,8,9);\n fill(0);\n noStroke();\n text("Array Elements", 0, 10);\n // Draw all numbers in the array\n var spacing = 15;\n var elemsY = 25;\n for(var i = 0; i < numArray.length; i++) {\n text(numArray[i], i * spacing, elemsY);\n }\n maxX = 33;\n maxY = 80;\n // Draw the Maximum value in the array.\n textSize(32);\n text(max(numArray), maxX, maxY);\n}\n</code></div>'],alt:"Small text at top reads: Array Elements 2 1 5 4 8 9. Large text at center: 9",class:"p5",module:"Math",submodule:"Calculation"},{file:"src/math/calculation.js",line:495,description:"<p>Determines the smallest value in a sequence of numbers, and then returns\nthat value. min() accepts any number of Number parameters, or an Array\nof any length.</p>\n",itemtype:"method",name:"min",params:[{name:"n0",description:"<p>Numbers to compare</p>\n",type:"Number|Array"}],return:{description:"minimum Number",type:"Number"},example:['\n<div><code>\nfunction setup() {\n // Change the elements in the array and run the sketch\n // to show how min() works!\n numArray = new Array(2,1,5,4,8,9);\n fill(0);\n noStroke();\n text("Array Elements", 0, 10);\n // Draw all numbers in the array\n var spacing = 15;\n var elemsY = 25;\n for(var i = 0; i < numArray.length; i++) {\n text(numArray[i], i * spacing, elemsY);\n }\n maxX = 33;\n maxY = 80;\n // Draw the Minimum value in the array.\n textSize(32);\n text(min(numArray), maxX, maxY);\n}\n</code></div>'],alt:"Small text at top reads: Array Elements 2 1 5 4 8 9. Large text at center: 1",class:"p5",module:"Math",submodule:"Calculation"},{file:"src/math/calculation.js",line:538,description:"<p>Normalizes a number from another range into a value between 0 and 1.\nIdentical to map(value, low, high, 0, 1).\nNumbers outside of the range are not clamped to 0 and 1, because\nout-of-range values are often intentional and useful. (See the second\nexample above.)</p>\n",itemtype:"method",name:"norm",params:[{name:"value",description:"<p>incoming value to be normalized</p>\n",type:"Number"},{name:"start",description:"<p>lower bound of the value's current range</p>\n",type:"Number"},{name:"stop",description:"<p>upper bound of the value's current range</p>\n",type:"Number"}],return:{description:"normalized number",type:"Number"},example:['\n<div><code>\nfunction draw() {\n background(200);\n currentNum = mouseX;\n lowerBound = 0;\n upperBound = width; //100;\n normalized = norm(currentNum, lowerBound, upperBound);\n lineY = 70\n line(0, lineY, width, lineY);\n //Draw an ellipse mapped to the non-normalized value.\n noStroke();\n fill(50)\n var s = 7; // ellipse size\n ellipse(currentNum, lineY, s, s);\n\n // Draw the guide\n guideY = lineY + 15;\n text("0", 0, guideY);\n textAlign(RIGHT);\n text("100", width, guideY);\n\n // Draw the normalized value\n textAlign(LEFT);\n fill(0);\n textSize(32);\n normalY = 40;\n normalX = 20;\n text(normalized, normalX, normalY);\n}\n</code></div>'],alt:"ellipse moves with mouse. 0 shown left & 100 right and updating values center",class:"p5",module:"Math",submodule:"Calculation"},{file:"src/math/calculation.js",line:590,description:"<p>Facilitates exponential expressions. The pow() function is an efficient\nway of multiplying numbers by themselves (or their reciprocals) in large\nquantities. For example, pow(3, 5) is equivalent to the expression\n3<em>3</em>3<em>3</em>3 and pow(3, -5) is equivalent to 1 / 3<em>3</em>3<em>3</em>3. Maps to\nMath.pow().</p>\n",itemtype:"method",name:"pow",params:[{name:"n",description:"<p>base of the exponential expression</p>\n",type:"Number"},{name:"e",description:"<p>power by which to raise the base</p>\n",type:"Number"}],return:{description:"n^e",type:"Number"},example:["\n<div><code>\nfunction setup() {\n //Exponentially increase the size of an ellipse.\°äŒf +description:"<p>Calculates the squared magnitude of the vector and returns the result\nas a float (this is simply the equation <em>(x<em>x + y</em>y + z*z)</em>.)\nFaster if the real length is not required in the\ncase of comparing vectors, etc.</p>\n",itemtype:"method",name:"magSq",return:{description:"squared magnitude of the vector",type:"Number"},example:['\n<div class="norender">\n<code>\n// Static method\nvar v1 = createVector(6, 4, 2);\nprint(v1.magSq()); // Prints "56"\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:379,description:"<p>Calculates the dot product of two vectors. The version of the method\nthat computes the dot product of two independent vectors is a static\nmethod. See the examples for more context.</p>\n",itemtype:"method",name:"dot",return:{description:"the dot product",type:"Number"},example:['\n<div class="norender">\n<code>\nvar v1 = createVector(1, 2, 3);\nvar v2 = createVector(2, 3, 4);\n\nprint(v1.dot(v2)); // Prints "20"\n</code>\n</div>\n\n<div class="norender">\n<code>\n//Static method\nvar v1 = createVector(1, 2, 3);\nvar v2 = createVector(3, 2, 1);\nprint (p5.Vector.dot(v1, v2)); // Prints "10"\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math",overloads:[{line:379,params:[{name:"x",description:"<p>x component of the vector or a p5.Vector</p>\n",type:"Number|p5.Vector"},{name:"y",description:"<p>y component of the vector</p>\n",type:"Number",optional:!0},{name:"z",description:"<p>z component of the vector</p>\n",type:"Number",optional:!0}],return:{description:"the dot product",type:"Number"}},{line:1021,params:[{name:"v1",description:"<p>the first p5.Vector</p>\n",type:"p5.Vector"},{name:"v2",description:"<p>the second p5.Vector</p>\n",type:"p5.Vector"}],static:1,return:{description:"the dot product",type:"Number"}}]},{file:"src/math/p5.Vector.js",line:419,description:"<p>Calculates and returns a vector composed of the cross product between\ntwo vectors. Both the static and non static methods return a new p5.Vector.\nSee the examples for more context.</p>\n",itemtype:"method",name:"cross",return:{description:"p5.Vector composed of cross product",type:"p5.Vector"},example:['\n<div class="norender">\n<code>\nvar v1 = createVector(1, 2, 3);\nvar v2 = createVector(1, 2, 3);\n\nv1.cross(v2); // v\'s components are [0, 0, 0]\n</code>\n</div>\n\n<div class="norender">\n<code>\n// Static method\nvar v1 = createVector(1, 0, 0);\nvar v2 = createVector(0, 1, 0);\n\nvar crossProduct = p5.Vector.cross(v1, v2);\n// crossProduct has components [0, 0, 1]\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math",overloads:[{line:419,params:[{name:"v",description:"<p>p5.Vector to be crossed</p>\n",type:"p5.Vector"}],return:{description:"p5.Vector composed of cross product",type:"p5.Vector"}},{line:1035,params:[{name:"v1",description:"<p>the first p5.Vector</p>\n",type:"p5.Vector"},{name:"v2",description:"<p>the second p5.Vector</p>\n",type:"p5.Vector"}],static:1,return:{description:"the cross product",type:"Number"}}]},{file:"src/math/p5.Vector.js",line:459,description:"<p>Calculates the Euclidean distance between two points (considering a\npoint as a vector object).</p>\n",itemtype:"method",name:"dist",return:{description:"the distance",type:"Number"},example:['\n<div class="norender">\n<code>\nvar v1 = createVector(1, 0, 0);\nvar v2 = createVector(0, 1, 0);\n\nvar distance = v1.dist(v2); // distance is 1.4142...\n</code>\n</div>\n<div class="norender">\n<code>\n// Static method\nvar v1 = createVector(1, 0, 0);\nvar v2 = createVector(0, 1, 0);\n\nvar distance = p5.Vector.dist(v1,v2);\n// distance is 1.4142...\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math",overloads:[{line:459,params:[{name:"v",description:"<p>the x, y, and z coordinates of a p5.Vector</p>\n",type:"p5.Vector"}],return:{description:"the distance",type:"Number"}},{line:1050,params:[{name:"v1",description:"<p>the first p5.Vector</p>\n",type:"p5.Vector"},{name:"v2",description:"<p>the second p5.Vector</p>\n",type:"p5.Vector"}],static:1,return:{description:"the distance",type:"Number"}}]},{file:"src/math/p5.Vector.js",line:491,description:"<p>Normalize the vector to length 1 (make it a unit vector).</p>\n",itemtype:"method",name:"normalize",return:{description:"normalized p5.Vector",type:"p5.Vector"},example:['\n<div class="norender">\n<code>\nvar v = createVector(10, 20, 2);\n// v has components [10.0, 20.0, 2.0]\nv.normalize();\n// v\'s components are set to\n// [0.4454354, 0.8908708, 0.089087084]\n</code>\n</div>\n'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:512,description:"<p>Limit the magnitude of this vector to the value used for the <b>max</b>\nparameter.</p>\n",itemtype:"method",name:"limit",params:[{name:"max",description:"<p>the maximum magnitude for the vector</p>\n",type:"Number"}],chainable:1,example:['\n<div class="norender">\n<code>\nvar v = createVector(10, 20, 2);\n// v has components [10.0, 20.0, 2.0]\nv.limit(5);\n// v\'s components are set to\n// [2.2271771, 4.4543543, 0.4454354]\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:539,description:"<p>Set the magnitude of this vector to the value used for the <b>len</b>\nparameter.</p>\n",itemtype:"method",name:"setMag",params:[{name:"len",description:"<p>the new length for this vector</p>\n",type:"Number"}],chainable:1,example:['\n<div class="norender">\n<code>\nvar v = createVector(10, 20, 2);\n// v has components [10.0, 20.0, 2.0]\nv.setMag(10);\n// v\'s components are set to [6.0, 8.0, 0.0]\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:560,description:"<p>Calculate the angle of rotation for this vector (only 2D vectors)</p>\n",itemtype:"method",name:"heading",return:{description:"the angle of rotation",type:"Number"},example:['\n<div class = "norender"><code>\nfunction setup() {\n var v1 = createVector(30,50);\n print(v1.heading()); // 1.0303768265243125\n\n var v1 = createVector(40,50);\n print(v1.heading()); // 0.8960553845713439\n\n var v1 = createVector(30,70);\n print(v1.heading()); // 1.1659045405098132\n}\n</div></code>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:592,description:"<p>Rotate the vector by an angle (only 2D vectors), magnitude remains the\nsame</p>\n",itemtype:"method",name:"rotate",params:[{name:"angle",description:"<p>the angle of rotation</p>\n",type:"Number"}],chainable:1,example:['\n<div class="norender">\n<code>\nvar v = createVector(10.0, 20.0);\n// v has components [10.0, 20.0, 0.0]\nv.rotate(HALF_PI);\n// v\'s components are set to [-20.0, 9.999999, 0.0]\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:622,description:"<p>Calculates and returns the angle (in radians) between two vectors.</p>\n",itemtype:"method",name:"angleBetween",params:[{name:"the",description:"<p>x, y, and z components of a p5.Vector</p>\n",type:"p5.Vector"}],return:{description:"the angle between (in radians)",type:"Number"},example:['\n<div class="norender">\n<code>\nvar v1 = createVector(1, 0, 0);\nvar v2 = createVector(0, 1, 0);\n\nvar angle = v1.angleBetween(v2);\n// angle is PI/2\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:654,description:"<p>Linear interpolate the vector to another vector</p>\n",itemtype:"method",name:"lerp",chainable:1,class:"p5.Vector",module:"Math",submodule:"Math",overloads:[{line:654,params:[{name:"x",description:"<p>the x component</p>\n",type:"p5.Vector"},{name:"y",description:"<p>the y component</p>\n",type:"p5.Vector"},{name:"z",description:"<p>the z component</p>\n",type:"p5.Vector"},{name:"amt",description:"<p>the amount of interpolation; some value between 0.0\n (old vector) and 1.0 (new vector). 0.1 is very near\n the new vector. 0.5 is halfway in between.</p>\n",type:"Number"}],chainable:1},{line:666,params:[{name:"v",description:"<p>the p5.Vector to lerp to</p>\n",type:"p5.Vector"},{name:"amt",description:"",type:"Number"}],chainable:1},{line:1065,params:[{name:"v1",description:"",type:"p5.Vector"},{name:"v2",description:"",type:"p5.Vector"},{name:"amt",description:"",type:"Number"},{name:"target",description:"<p>if undefined a new vector will be created</p>\n",type:"p5.Vector"}],static:1},{line:1073,params:[{name:"v1",description:"",type:"p5.Vector"},{name:"v2",description:"",type:"p5.Vector"},{name:"amt",description:"",type:"Number"}],static:1,return:{description:"the lerped value",type:"Number"}}]},{file:"src/math/p5.Vector.js",line:701,description:"<p>Return a representation of this vector as a float array. This is only\nfor temporary use. If used in any other fashion, the contents should be\ncopied by using the <b>p5.Vector.copy()</b> method to copy into your own\narray.</p>\n",itemtype:"method",name:"array",return:{description:"an Array with the 3 values",type:"Number[]"},example:['\n<div class = "norender"><code>\nfunction setup() {\n var v = createVector(20,30);\n print(v.array()); // Prints : Array [20, 30, 0]\n}\n</div></code>\n<div class="norender">\n<code>\nvar v = createVector(10.0, 20.0, 30.0);\nvar f = v.array();\nprint(f[0]); // Prints "10.0"\nprint(f[1]); // Prints "20.0"\nprint(f[2]); // Prints "30.0"\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:730,description:"<p>Equality check against a p5.Vector</p>\n",itemtype:"method",name:"equals",params:[{name:"x",description:"<p>the x component of the vector or a\n p5.Vector or an Array</p>\n",type:"Number|p5.Vector|Array",optional:!0},{name:"y",description:"<p>the y component of the vector</p>\n",type:"Number",optional:!0},{name:"z",description:"<p>the z component of the vector</p>\n",type:"Number",optional:!0}],return:{description:"whether the vectors are equals",type:"Boolean"},example:['\n<div class = "norender"><code>\nv1 = createVector(5,10,20);\nv2 = createVector(5,10,20);\nv3 = createVector(13,10,19);\n\nprint(v1.equals(v2.x,v2.y,v2.z)); // true\nprint(v1.equals(v3.x,v3.y,v3.z)); // false\n</div></code>\n<div class="norender">\n<code>\nvar v1 = createVector(10.0, 20.0, 30.0);\nvar v2 = createVector(10.0, 20.0, 30.0);\nvar v3 = createVector(0.0, 0.0, 0.0);\nprint (v1.equals(v2)) // true\nprint (v1.equals(v3)) // false\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:780,description:"<p>Make a new 2D unit vector from an angle</p>\n",itemtype:"method",name:"fromAngle",static:1,params:[{name:"angle",description:"<p>the desired angle</p>\n",type:"Number"}],return:{description:"the new p5.Vector object",type:"p5.Vector"},example:['\n<div>\n<code>\nfunction draw() {\n background (200);\n\n // Create a variable, proportional to the mouseX,\n // varying from 0-360, to represent an angle in degrees.\n angleMode(DEGREES);\n var myDegrees = map(mouseX, 0,width, 0,360);\n\n // Display that variable in an onscreen text.\n // (Note the nfc() function to truncate additional decimal places,\n // and the "\\xB0" character for the degree symbol.)\n var readout = "angle = " + nfc(myDegrees,1,1) + "\\xB0"\n noStroke();\n fill (0);\n text (readout, 5, 15);\n\n // Create a p5.Vector using the fromAngle function,\n // and extract its x and y components.\n var v = p5.Vector.fromAngle(radians(myDegrees));\n var vx = v.x;\n var vy = v.y;\n\n push();\n translate (width/2, height/2);\n noFill();\n stroke (150);\n line (0,0, 30,0);\n stroke (0);\n line (0,0, 30*vx, 30*vy);\n pop()\n}\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:837,description:"<p>Make a new 2D unit vector from a random angle</p>\n",itemtype:"method",name:"random2D",static:1,return:{description:"the new p5.Vector object",type:"p5.Vector"},example:['\n<div class="norender">\n<code>\nvar v = p5.Vector.random2D();\n// May make v\'s attributes something like:\n// [0.61554617, -0.51195765, 0.0] or\n// [-0.4695841, -0.14366731, 0.0] or\n// [0.6091097, -0.22805278, 0.0]\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:870,description:"<p>Make a new random 3D unit vector.</p>\n",itemtype:"method",name:"random3D",static:1,return:{description:"the new p5.Vector object",type:"p5.Vector"},example:['\n<div class="norender">\n<code>\nvar v = p5.Vector.random3D();\n// May make v\'s attributes something like:\n// [0.61554617, -0.51195765, 0.599168] or\n// [-0.4695841, -0.14366731, -0.8711202] or\n// [0.6091097, -0.22805278, -0.7595902]\n</code>\n</div>'],class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:963,description:"<p>Multiplies a vector by a scalar and returns a new vector.</p>\n",class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:990,description:"<p>Divides a vector by a scalar and returns a new vector.</p>\n",class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:1018,description:"<p>Calculates the dot product of two vectors.</p>\n",class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:1032,description:"<p>Calculates the cross product of two vectors.</p>\n",class:"p5.Vector",module:"Math",submodule:"Math"},{file:"src/math/p5.Vector.js",line:1046,descrip°äŒf +description:"<p>Loads an opentype font file (.otf, .ttf) from a file or a URL,\nand returns a PFont Object. This method is asynchronous,\nmeaning it may not finish before the next line in your sketch\nis executed.\n<br><br>\nThe path to the font should be relative to the HTML file\nthat links in your sketch. Loading an from a URL or other\nremote location may be blocked due to your browser's built-in\nsecurity.</p>\n",itemtype:"method",name:"loadFont",params:[{name:"path",description:"<p>name of the file or url to load</p>\n",type:"String"},{name:"callback",description:"<p>function to be executed after\n loadFont()\n completes</p>\n",type:"Function",optional:!0}],return:{description:"p5.Font object",type:"p5.Font"},example:["\n\n<p>Calling loadFont() inside preload() guarantees that the load\noperation will have completed before setup() and draw() are called.</p>\n\n<div><code>\nvar myFont;\nfunction preload() {\n myFont = loadFont('assets/AvenirNextLTPro-Demi.otf');\n}\n\nfunction setup() {\n fill('#ED225D');\n textFont(myFont);\n textSize(36);\n text('p5*js', 10, 50);\n}\n</code></div>\n\nOutside of preload(), you may supply a callback function to handle the\nobject:\n\n<div><code>\nfunction setup() {\n loadFont('assets/AvenirNextLTPro-Demi.otf', drawText);\n}\n\nfunction drawText(font) {\n fill('#ED225D');\n textFont(font, 36);\n text('p5*js', 10, 50);\n}\n\n</code></div>\n\n<p>You can also use the string name of the font to style other HTML\nelements.</p>\n\n<div><code>\nvar myFont;\n\nfunction preload() {\n myFont = loadFont('assets/Avenir.otf');\n}\n\nfunction setup() {\n var myDiv = createDiv('hello there');\n myDiv.style('font-family', 'Avenir');\n}\n</code></div>"],alt:"p5*js in p5's theme dark pink\np5*js in p5's theme dark pink",class:"p5",module:"Typography",submodule:"Loading & Displaying"},{file:"src/typography/loading_displaying.js",line:135,description:"<p>Draws text to the screen. Displays the information specified in the first\nparameter on the screen in the position specified by the additional\nparameters. A default font will be used unless a font is set with the\ntextFont() function and a default size will be used unless a font is set\nwith textSize(). Change the color of the text with the fill() function.\nChange the outline of the text with the stroke() and strokeWeight()\nfunctions.\n<br><br>\nThe text displays in relation to the textAlign() function, which gives the\noption to draw to the left, right, and center of the coordinates.\n<br><br>\nThe x2 and y2 parameters define a rectangular area to display within and\nmay only be used with string data. When these parameters are specified,\nthey are interpreted based on the current rectMode() setting. Text that\ndoes not fit completely within the rectangle specified will not be drawn\nto the screen.</p>\n",itemtype:"method",name:"text",params:[{name:"str",description:"<p>the alphanumeric symbols to be displayed</p>\n",type:"String"},{name:"x",description:"<p>x-coordinate of text</p>\n",type:"Number"},{name:"y",description:"<p>y-coordinate of text</p>\n",type:"Number"},{name:"x2",description:"<p>by default, the width of the text box,\n see rectMode() for more info</p>\n",type:"Number",optional:!0},{name:"y2",description:"<p>by default, the height of the text box,\n see rectMode() for more info</p>\n",type:"Number",optional:!0}],return:{description:"this",type:"P5"},example:['\n<div>\n<code>\ntextSize(32);\ntext("word", 10, 30);\nfill(0, 102, 153);\ntext("word", 10, 60);\nfill(0, 102, 153, 51);\ntext("word", 10, 90);\n</code>\n</div>\n<div>\n<code>\ns = "The quick brown fox jumped over the lazy dog.";\nfill(50);\ntext(s, 10, 10, 70, 80); // Text wraps within text box\n</code>\n</div>'],alt:"'word' displayed 3 times going from black, blue to translucent blue\nThe quick brown fox jumped over the lazy dog.",class:"p5",module:"Typography",submodule:"Loading & Displaying"},{file:"src/typography/loading_displaying.js",line:191,description:"<p>Sets the current font that will be drawn with the text() function.</p>\n",itemtype:"method",name:"textFont",return:{description:"the current font",type:"Object"},class:"p5",module:"Typography",submodule:"Loading & Displaying",overloads:[{line:191,params:[],return:{description:"the current font",type:"Object"}},{line:197,params:[{name:"font",description:'<p>a font loaded via loadFont(), or a String\nrepresenting a <a href="https://mzl.la/2dOw8WD">web safe font</a> (a font\nthat is generally available across all systems)</p>\n',type:"Object|String"},{name:"size",description:"<p>the font size to use</p>\n",type:"Number",optional:!0}],chainable:1}]},{file:"src/typography/p5.Font.js",line:33,description:"<p>Underlying opentype font implementation</p>\n",itemtype:"property",name:"font",class:"p5.Font",module:"Typography",submodule:"Font"},{file:"src/typography/p5.Font.js",line:47,description:"<p>Returns a tight bounding box for the given text string using this\nfont (currently only supports single lines)</p>\n",itemtype:"method",name:"textBounds",params:[{name:"line",description:"<p>a line of text</p>\n",type:"String"},{name:"x",description:"<p>x-position</p>\n",type:"Number"},{name:"y",description:"<p>y-position</p>\n",type:"Number"},{name:"fontSize",description:"<p>font size to use (optional)</p>\n",type:"Number"},{name:"options",description:"<p>opentype options (optional)</p>\n",type:"Object"}],return:{description:"a rectangle object with properties: x, y, w, h",type:"Object"},example:["\n<div>\n<code>\nvar font;\nvar textString = 'Lorem ipsum dolor sit amet.';\nfunction preload() {\n font = loadFont('./assets/Regular.otf');\n};\nfunction setup() {\n background(210);\n\n var bbox = font.textBounds(textString, 10, 30, 12);\n fill(255);\n stroke(0);\n rect(bbox.x, bbox.y, bbox.w, bbox.h);\n fill(0);\n noStroke();\n\n textFont(font);\n textSize(12);\n text(textString, 10, 30);\n};\n</code>\n</div>"],alt:"words Lorem ipsum dol go off canvas and contained by white bounding box",class:"p5.Font",module:"Typography",submodule:"Font"},{file:"src/typography/p5.Font.js",line:148,description:"<p>Computes an array of points following the path for specified text</p>\n",params:[{name:"txt",description:"<p>a line of text</p>\n",type:"String"},{name:"x",description:"<p>x-position</p>\n",type:"Number"},{name:"y",description:"<p>y-position</p>\n",type:"Number"},{name:"fontSize",description:"<p>font size to use (optional)</p>\n",type:"Number"},{name:"options",description:"<p>an (optional) object that can contain:</p>\n<p><br>sampleFactor - the ratio of path-length to number of samples\n(default=.25); higher values yield more points and are therefore\nmore precise</p>\n<p><br>simplifyThreshold - if set to a non-zero value, collinear points will be\nbe removed from the polygon; the value represents the threshold angle to use\nwhen determining whether two edges are collinear</p>\n",type:"Object"}],return:{description:"an array of points, each with x, y, alpha (the path angle)",type:"Array"},class:"p5.Font",module:"Typography",submodule:"Font"},{file:"src/typography/p5.Font.js",line:205,description:"<p>Returns the set of opentype glyphs for the supplied string.</p>\n<p>Note that there is not a strict one-to-one mapping between characters\nand glyphs, so the list of returned glyphs can be larger or smaller\n than the length of the given string.</p>\n",params:[{name:"str",description:"<p>the string to be converted</p>\n",type:"String"}],return:{description:"the opentype glyphs",type:"Array"},class:"p5.Font",module:"Typography",submodule:"Font"},{file:"src/typography/p5.Font.js",line:220,description:"<p>Returns an opentype path for the supplied string and position.</p>\n",params:[{name:"line",description:"<p>a line of text</p>\n",type:"String"},{name:"x",description:"<p>x-position</p>\n",type:"Number"},{name:"y",description:"<p>y-position</p>\n",type:"Number"},{name:"options",description:"<p>opentype options (optional)</p>\n",type:"Object"}],return:{description:"the opentype path",type:"Object"},class:"p5.Font",module:"Typography",submodule:"Font"},{file:"src/utilities/array_functions.js",line:12,description:"<p>Adds a value to the end of an array. Extends the length of\nthe array by one. Maps to Array.push().</p>\n",itemtype:"method",name:"append",params:[{name:"array",description:"<p>Array to append</p>\n",type:"Array"},{name:"value",description:"<p>to be added to the Array</p>\n",type:"Any"}],example:['\n<div class = "norender"><code>\nfunction setup() {\n\nvar myArray = new Array("Mango", "Apple", "Papaya")\nprint(myArray) // ["Mango", "Apple", "Papaya"]\n\nappend(myArray, "Peach")\nprint(myArray) // ["Mango", "Apple", "Papaya", "Peach"]\n\n}\n</div></code>'],class:"p5",module:"Data",submodule:"Array Functions"},{file:"src/utilities/array_functions.js",line:37,description:"<p>Copies an array (or part of an array) to another array. The src array is\ncopied to the dst array, beginning at the position specified by\nsrcPosition and into the position specified by dstPosition. The number of\nelements to copy is determined by length. Note that copying values\noverwrites existing values in the destination array. To append values\ninstead of overwriting them, use concat().\n<br><br>\nThe simplified version with only two arguments, arrayCopy(src, dst),\ncopies an entire array to another of the same size. It is equivalent to\narrayCopy(src, 0, dst, 0, src.length).\n<br><br>\nUsing this function is far more efficient for copying array data than\niterating through a for() loop and copying each element individually.</p>\n",itemtype:"method",name:"arrayCopy",class:"p5",module:"Data",submodule:"Array Functions",overloads:[{line:37,params:[{name:"src",description:"<p>the source Array</p>\n",type:"Array"},{name:"srcPosition",description:"<p>starting position in the source Array</p>\n",type:"Number"},{name:"dst",description:"<p>the destination Array</p>\n",type:"Array"},{name:"dstPosition",description:"<p>starting position in the destination Array</p>\n",type:"Number"},{name:"length",description:"<p>number of Array elements to be copied</p>\n",type:"Number"}]},{line:59,params:[{name:"src",description:"",type:"Array"},{name:"dst",description:"",type:"Array"},{name:"length",description:"",type:"Number",optional:!0}]}]},{file:"src/utilities/array_functions.js",line:124,description:"<p>Concatenates two arrays, maps to Array.concat(). Does not modify the\ninput arrays.</p>\n",itemtype:"method",name:"concat",params:[{name:"a",description:"<p>first Array to concatenate</p>\n",type:"Array"},{name:"b",description:"<p>second Array to concatenate</p>\n",type:"Array"}],return:{description:"concatenated array",type:"Array"},example:['\n<div class = "norender"><code>\nfunction setup() {\n var arr1 = new Array("A", "B", "C");\n var arr2 = new Array( 1 , 2 , 3 );\n\n print(arr1); // ["A","B","C"]\n print(arr2); // [1,2,3]\n\n var arr3 = concat(arr1, arr2);\n\n print(arr1); // ["A","B","C"]\n print(arr2); // [1,2,3]\n print(arr3); // ["A","B","C",1,2,3]\n\n}\n</div></code>'],class:"p5",module:"Data",submodule:"Array Functions"},{file:"src/utilities/array_functions.js",line:155,description:"<p>Reverses the order of an array, maps to Array.reverse()</p>\n",itemtype:"method",name:"reverse",params:[{name:"list",description:"<p>Array to reverse</p>\n",type:"Array"}],example:['\n<div class="norender"><code>\nfunction setup() {\n var myArray = new Array("A", "B", "C");\n print(myArray); // ["A","B","C"]\n\n reverse(myArray);\n print(myArray); // ["C","B","A"]\n}\n</div></code>'],class:"p5",module:"Data",submodule:"Array Functions"},{file:"src/utilities/array_functions.js",line:175,description:"<p>Decreases an array by one element and returns the shortened array,\nmaps to Array.pop().</p>\n",itemtype:"method",name:"shorten",params:[{name:"list",description:"<p>Array to shorten</p>\n",type:"Array"}],return:{description:"shortened Array",type:"Array"},example:['\n<div class = "norender"><code>\nfunction setup() {\n var myArray = new Array("A", "B", "C");\n print(myArray); // ["A","B","C"]\n\n var newArray = shorten(myArray);\n print(myArray); // ["A","B","C"]\n print(newArray); // ["A","B"]\n}\n</div></code>'],class:"p5",module:"Data",submodule:"Array Functions"},{file:"src/utilities/array_functions.js",line:199,description:'<p>Randomizes the order of the elements of an array. Implements\n<a href="http://Bost.Ocks.org/mike/shuffle/" target=_blank>\nFisher-Yates Shuffle Algorithm</a>.</p>\n',itemtype:"method",name:"shuffle",params:[{name:"array",description:"<p>Array to shuffle</p>\n",type:"Array"},{name:"bool",description:"<p>modify passed array</p>\n",type:"Boolean",optional:!0}],return:{description:"shuffled Array",type:"Array"},example:["\n<div><code>\nfunction setup() {\n var regularArr = ['ABC', 'def', createVector(), TAU, Math.E];\n print(regularArr);\n shuffle(regularArr, true); // force modifications to passed array\n print(regularArr);\n\n // By default shuffle() returns a shuffled cloned array:\n var newArr = shuffle(regularArr);\n print(regularArr);\n print(newArr);\n}\n</code></div>"],class:"p5",module:"Data",submodule:"Array Functions"},{file:"src/utilities/array_functions.js",line:239,description:"<p>Sorts an array of numbers from smallest to largest, or puts an array of\nwords in alphabetical order. The original array is not modified; a\nre-ordered array is returned. The count parameter states the number of\nelements to sort. For example, if there are 12 elements in an array and\ncount is set to 5, only the first 5 elements in the array will be sorted.</p>\n",itemtype:"method",name:"sort",params:[{name:"list",description:"<p>Array to sort</p>\n",type:"Array"},{name:"count",description:"<p>number of elements to sort, starting from 0</p>\n",type:"Number",optional:!0}],example:['\n<div class = "norender"><code>\nfunction setup() {\n var words = new Array("banana", "apple", "pear","lime");\n print(words); // ["banana", "apple", "pear", "lime"]\n var count = 4; // length of array\n\n words = sort(words, count);\n print(words); // ["apple", "banana", "lime", "pear"]\n}\n</div></code>\n<div class = "norender"><code>\nfunction setup() {\n var numbers = new Array(2,6,1,5,14,9,8,12);\n print(numbers); // [2,6°äŒf +description:"<p>Utility function for formatting numbers into strings. Similar to nf() but\nputs a " " (space) in front of positive numbers and a "-" in front of\nnegative numbers. There are two versions: one for formatting floats, and\none for formatting ints. The values for the digits, left, and right\nparameters should always be positive integers.</p>\n",itemtype:"method",name:"nfs",return:{description:"formatted String",type:"String"},class:"p5",module:"Data",submodule:"String Functions",overloads:[{line:389,params:[{name:"num",description:"<p>the Number to format</p>\n",type:"Number"},{name:"left",description:"<p>number of digits to the left of the decimal\n point</p>\n",type:"Number",optional:!0},{name:"right",description:"<p>number of digits to the right of the\n decimal point</p>\n",type:"Number",optional:!0}],return:{description:"formatted String",type:"String"}},{line:404,params:[{name:"nums",description:"<p>the Numbers to format</p>\n",type:"Array"},{name:"left",description:"",type:"Number",optional:!0},{name:"right",description:"",type:"Number",optional:!0}],return:{description:"formatted Strings",type:"Array"}}]},{file:"src/utilities/string_functions.js",line:454,description:"<p>The split() function maps to String.split(), it breaks a String into\npieces using a character or string as the delimiter. The delim parameter\nspecifies the character or characters that mark the boundaries between\neach piece. A String[] array is returned that contains each of the pieces.</p>\n<p>The splitTokens() function works in a similar fashion, except that it\nsplits using a range of characters instead of a specific character or\nsequence.</p>\n",itemtype:"method",name:"split",params:[{name:"value",description:"<p>the String to be split</p>\n",type:"String"},{name:"delim",description:"<p>the String used to separate the data</p>\n",type:"String"}],return:{description:"Array of Strings",type:"String[]"},example:['\n<div>\n<code>\nvar names = "Pat,Xio,Alex"\nvar splitString = split(names, ",");\ntext(splitString[0], 5, 30);\ntext(splitString[1], 5, 50);\ntext(splitString[2], 5, 70);\n</code>\n</div>'],alt:'"pat" top left, "Xio" mid left and "Alex" displayed bottom left',class:"p5",module:"Data",submodule:"String Functions"},{file:"src/utilities/string_functions.js",line:488,description:"<p>The splitTokens() function splits a String at one or many character\ndelimiters or "tokens." The delim parameter specifies the character or\ncharacters to be used as a boundary.\n<br><br>\nIf no delim characters are specified, any whitespace character is used to\nsplit. Whitespace characters include tab (\\t), line feed (\\n), carriage\nreturn (\\r), form feed (\\f), and space.</p>\n",itemtype:"method",name:"splitTokens",params:[{name:"value",description:"<p>the String to be split</p>\n",type:"String"},{name:"delim",description:"<p>list of individual Strings that will be used as\n separators</p>\n",type:"String",optional:!0}],return:{description:"Array of Strings",type:"String[]"},example:['\n<div class = "norender">\n<code>\nfunction setup() {\n var myStr = "Mango, Banana, Lime";\n var myStrArr = splitTokens(myStr, ",");\n\n print(myStrArr); // prints : ["Mango"," Banana"," Lime"]\n}\n</code>\n</div>'],class:"p5",module:"Data",submodule:"String Functions"},{file:"src/utilities/string_functions.js",line:541,description:"<p>Removes whitespace characters from the beginning and end of a String. In\naddition to standard whitespace characters such as space, carriage return,\nand tab, this function also removes the Unicode "nbsp" character.</p>\n",itemtype:"method",name:"trim",return:{description:"a trimmed String",type:"String"},class:"p5",module:"Data",submodule:"String Functions",overloads:[{line:541,params:[{name:"str",description:"<p>a String to be trimmed</p>\n",type:"String"}],return:{description:"a trimmed String",type:"String"}},{line:550,params:[{name:"strs",description:"<p>an Array of Strings to be trimmed</p>\n",type:"Array"}],return:{description:"an Array of trimmed Strings",type:"Array"}}]},{file:"src/utilities/time_date.js",line:12,description:"<p>p5.js communicates with the clock on your computer. The day() function\nreturns the current day as a value from 1 - 31.</p>\n",itemtype:"method",name:"day",return:{description:"the current day",type:"Number"},example:['\n<div>\n<code>\nvar d = day();\ntext("Current day: \\n" + d, 5, 50);\n</code>\n</div>'],alt:"Current day is displayed",class:"p5",module:"IO",submodule:"Time & Date"},{file:"src/utilities/time_date.js",line:34,description:"<p>p5.js communicates with the clock on your computer. The hour() function\nreturns the current hour as a value from 0 - 23.</p>\n",itemtype:"method",name:"hour",return:{description:"the current hour",type:"Number"},example:['\n<div>\n<code>\nvar h = hour();\ntext("Current hour:\\n" + h, 5, 50);\n</code>\n</div>'],alt:"Current hour is displayed",class:"p5",module:"IO",submodule:"Time & Date"},{file:"src/utilities/time_date.js",line:56,description:"<p>p5.js communicates with the clock on your computer. The minute() function\nreturns the current minute as a value from 0 - 59.</p>\n",itemtype:"method",name:"minute",return:{description:"the current minute",type:"Number"},example:['\n<div>\n<code>\nvar m = minute();\ntext("Current minute: \\n" + m, 5, 50);\n</code>\n</div>'],alt:"Current minute is displayed",class:"p5",module:"IO",submodule:"Time & Date"},{file:"src/utilities/time_date.js",line:78,description:"<p>Returns the number of milliseconds (thousandths of a second) since\nstarting the program. This information is often used for timing events and\nanimation sequences.</p>\n",itemtype:"method",name:"millis",return:{description:"the number of milliseconds since starting the program",type:"Number"},example:['\n<div>\n<code>\nvar millisecond = millis();\ntext("Milliseconds \\nrunning: \\n" + millisecond, 5, 40);\n</code>\n</div>'],alt:"number of milliseconds since program has started displayed",class:"p5",module:"IO",submodule:"Time & Date"},{file:"src/utilities/time_date.js",line:101,description:"<p>p5.js communicates with the clock on your computer. The month() function\nreturns the current month as a value from 1 - 12.</p>\n",itemtype:"method",name:"month",return:{description:"the current month",type:"Number"},example:['\n<div>\n<code>\nvar m = month();\ntext("Current month: \\n" + m, 5, 50);\n</code>\n</div>'],alt:"Current month is displayed",class:"p5",module:"IO",submodule:"Time & Date"},{file:"src/utilities/time_date.js",line:123,description:"<p>p5.js communicates with the clock on your computer. The second() function\nreturns the current second as a value from 0 - 59.</p>\n",itemtype:"method",name:"second",return:{description:"the current second",type:"Number"},example:['\n<div>\n<code>\nvar s = second();\ntext("Current second: \\n" + s, 5, 50);\n</code>\n</div>'],alt:"Current second is displayed",class:"p5",module:"IO",submodule:"Time & Date"},{file:"src/utilities/time_date.js",line:145,description:"<p>p5.js communicates with the clock on your computer. The year() function\nreturns the current year as an integer (2014, 2015, 2016, etc).</p>\n",itemtype:"method",name:"year",return:{description:"the current year",type:"Number"},example:['\n<div>\n<code>\nvar y = year();\ntext("Current year: \\n" + y, 5, 50);\n</code>\n</div>'],alt:"Current year is displayed",class:"p5",module:"IO",submodule:"Time & Date"},{file:"src/webgl/camera.js",line:12,description:"<p>Sets camera position</p>\n",itemtype:"method",name:"camera",params:[{name:"x",description:"<p>camera position value on x axis</p>\n",type:"Number"},{name:"y",description:"<p>camera position value on y axis</p>\n",type:"Number"},{name:"z",description:"<p>camera position value on z axis</p>\n",type:"Number"}],return:{description:"the p5 object",type:"P5"},example:["\n<div>\n<code>\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\nfunction draw(){\n //move the camera away from the plane by a sin wave\n camera(0, 0, sin(frameCount * 0.01) * 100);\n plane(120, 120);\n}\n</code>\n</div>"],alt:"blue square shrinks in size grows to fill canvas. disappears then loops.",class:"p5",module:"Lights, Camera",submodule:"Camera"},{file:"src/webgl/camera.js",line:42,description:"<p>Sets perspective camera</p>\n",itemtype:"method",name:"perspective",params:[{name:"fovy",description:"<p>camera frustum vertical field of view,\n from bottom to top of view, in degrees</p>\n",type:"Number"},{name:"aspect",description:"<p>camera frustum aspect ratio</p>\n",type:"Number"},{name:"near",description:"<p>frustum near plane length</p>\n",type:"Number"},{name:"far",description:"<p>frustum far plane length</p>\n",type:"Number"}],return:{description:"the p5 object",type:"P5"},example:["\n<div>\n<code>\n//drag mouse to toggle the world!\n//you will see there's a vanish point\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n var fov = 60 / 180 * PI;\n var cameraZ = (height/2.0) / tan(fov/2.0);\n perspective(60 / 180 * PI, width/height, cameraZ * 0.1, cameraZ * 10);\n}\nfunction draw(){\n background(200);\n orbitControl();\n for(var i = -1; i < 2; i++){\n for(var j = -2; j < 3; j++){\n push();\n translate(i*160, 0, j*160);\n box(40, 40, 40);\n pop();\n }\n }\n}\n</code>\n</div>"],alt:"colored 3d boxes toggleable with mouse position",class:"p5",module:"Lights, Camera",submodule:"Camera"},{file:"src/webgl/camera.js",line:91,description:"<p>Setup ortho camera</p>\n",itemtype:"method",name:"ortho",params:[{name:"left",description:"<p>camera frustum left plane</p>\n",type:"Number"},{name:"right",description:"<p>camera frustum right plane</p>\n",type:"Number"},{name:"bottom",description:"<p>camera frustum bottom plane</p>\n",type:"Number"},{name:"top",description:"<p>camera frustum top plane</p>\n",type:"Number"},{name:"near",description:"<p>camera frustum near plane</p>\n",type:"Number"},{name:"far",description:"<p>camera frustum far plane</p>\n",type:"Number"}],return:{description:"the p5 object",type:"P5"},example:["\n<div>\n<code>\n//drag mouse to toggle the world!\n//there's no vanish point\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n ortho(-width/2, width/2, height/2, -height/2, 0, 500);\n}\nfunction draw(){\n background(200);\n orbitControl();\n for(var i = -1; i < 2; i++){\n for(var j = -2; j < 3; j++){\n push();\n translate(i*160, 0, j*160);\n box(40, 40, 40);\n pop();\n }\n }\n}\n</code>\n</div>"],alt:"3 3d boxes, reveal several more boxes on 3d plane when mouse used to toggle",class:"p5",module:"Lights, Camera",submodule:"Camera"},{file:"src/webgl/light.js",line:12,description:"<p>Creates an ambient light with a color</p>\n",itemtype:"method",name:"ambientLight",chainable:1,class:"p5",module:"Lights, Camera",submodule:"Lights",overloads:[{line:12,params:[{name:"v1",description:"<p>red or hue value relative to\n the current color range</p>\n",type:"Number"},{name:"v2",description:"<p>green or saturation value\n relative to the current color range</p>\n",type:"Number"},{name:"v3",description:"<p>blue or brightness value\n relative to the current color range</p>\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}],chainable:1},{line:26,params:[{name:"value",description:"<p>a color string</p>\n",type:"String"},{name:"alpha",description:"",type:"Number",optional:!0}],chainable:1},{line:33,params:[{name:"values",description:"<p>an array containing the red,green,blue &\n and alpha components of the color</p>\n",type:"Number[]"}],chainable:1},{line:40,params:[{name:"color",description:"<p>the ambient light color</p>\n",type:"p5.Color"},{name:"alpha",description:"",type:"Number",optional:!0}],chainable:1}]},{file:"src/webgl/light.js",line:96,description:"<p>Creates a directional light with a color and a direction</p>\n",itemtype:"method",name:"directionalLight",params:[{name:"v1",description:"<p>gray value,\nred or hue value (depending on the current color mode),\nor color Array, or CSS color string</p>\n",type:"Number|Array|String|p5.Color"},{name:"v2",description:"<p>optional: green or saturation value</p>\n",type:"Number",optional:!0},{name:"v3",description:"<p>optional: blue or brightness value</p>\n",type:"Number",optional:!0},{name:"a",description:"<p>optional: opacity</p>\n",type:"Number",optional:!0},{name:"x",description:"<p>x axis direction or a p5.Vector</p>\n",type:"Number|p5.Vector"},{name:"y",description:"<p>optional: y axis direction</p>\n",type:"Number",optional:!0},{name:"z",description:"<p>optional: z axis direction</p>\n",type:"Number",optional:!0}],chainable:1,example:["\n<div>\n<code>\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\nfunction draw(){\n background(0);\n //move your mouse to change light direction\n var dirX = (mouseX / width - 0.5) *2;\n var dirY = (mouseY / height - 0.5) *(-2);\n directionalLight(250, 250, 250, dirX, dirY, 0.25);\n ambientMaterial(250);\n sphere(50);\n}\n</code>\n</div>"],alt:"light source on canvas changeable with mouse position",class:"p5",module:"Lights, Camera",submodule:"Lights"},{file:"src/webgl/light.js",line:190,description:"<p>Creates a point light with a color and a light position</p>\n",itemtype:"method",name:"pointLight",params:[{name:"v1",description:"<p>gray value,\nred or hue value (depending on the current color mode),\nor color Array, or CSS color string</p>\n",type:"Number|Array|String|p5.Color"},{name:"v2",description:"<p>optional: green or saturation value</p>\n",type:"Number",optional:!0},{name:"v3",description:"<p>optional: blue or brightness value</p>\n",type:"Number",optional:!0},{name:"a",description:"<p>optional: opacity</p>\n",type:"Number",optional:!0},{name:"x",description:"<p>x axis position or a p5.Vector</p>\n",type:"Number|p5.Vector"},{name:"y",description:"<p>optional: y axis position</p>\n",type:"Number",optional:!0},{name:"z",description:"<p>optional: z axis position</p>\n",type:"Number",optional:!0}],chainable:1,example:["\n<div>\n<code>\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\nfunction draw(){\n background(0);\n //move your mouse to change light position\n var locY = (mouseY / height - 0.5) *(-2);\n var locX = (mouseX / width - 0.5) *2;\n //to set the light position,\n //think of the world's coordinate as:\n // -1,1 -------- 1,1\n // | |\n // | |\n // | |\n // -1,-1---------1,-1\n pointLight(250, 250, 250, locX, locY, 0);\n ambientMaterial(250);\n sphere(50);\n}\n</code>\n</div>"],alt:"spot light on canvas changes position with mouse",class:"p5",module:"Lights, Camera",submodule:"Lights"},{file:"src/webgl/loading.js",line:14,description:"<p>Load a 3d model from an OBJ file.\n<br><br>\nOne of the limitations of the OBJ format is that it doesn't have a built-in\nsense of scale. This means that models exported from different programs might\nbe very different sizes. If your model isn't displaying, try calling\nloadModel() with the normalized parameter set to°äŒf +description:"<p>initializes buffer defaults. runs each time a new geometry is\nregistered</p>\n",params:[{name:"gId",description:"<p>key of the geometry object</p>\n",type:"String"}],class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.Retained.js",line:30,description:"<p>createBuffers description</p>\n",params:[{name:"gId",description:"<p>key of the geometry object</p>\n",type:"String"},{name:"obj",description:"<p>contains geometry data</p>\n",type:"p5.Geometry"}],class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.Retained.js",line:93,description:"<p>Draws buffers given a geometry key ID</p>\n",params:[{name:"gId",description:"<p>ID in our geom hash</p>\n",type:"String"}],chainable:1,class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.Retained.js",line:129,description:"<p>turn a two dimensional array into one dimensional array</p>\n",params:[{name:"arr",description:"<p>2-dimensional array</p>\n",type:"Array"}],return:{description:"1-dimensional array\n[[1, 2, 3],[4, 5, 6]] -> [1, 2, 3, 4, 5, 6]",type:"Array"},class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.Retained.js",line:145,description:"<p>turn a p5.Vector Array into a one dimensional number array</p>\n",params:[{name:"arr",description:"<p>an array of p5.Vector</p>\n",type:"p5.Vector[]"}],return:{description:"a one dimensional array of numbers\n[p5.Vector(1, 2, 3), p5.Vector(4, 5, 6)] ->\n[1, 2, 3, 4, 5, 6]",type:"Number[]"},class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:42,description:"<p>model view, projection, & normal\nmatrices</p>\n",class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:108,description:"<p>[background description]</p>\n",class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:131,description:"<p>[_initShaders description]</p>\n",params:[{name:"vertId",description:"<p>[description]</p>\n",type:"String"},{name:"fragId",description:"<p>[description]</p>\n",type:"String"}],return:{description:"the shader program",type:"Object"},class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:203,description:"<p>Sets a shader uniform given a shaderProgram and uniform string</p>\n",params:[{name:"shaderKey",description:"<p>key to material Hash.</p>\n",type:"String"},{name:"uniform",description:"<p>location in shader.</p>\n",type:"String"},{name:"data",description:"<p>data to bind uniform. Float data type.</p>\n",type:"Number"}],chainable:1,todo:["currently this function sets uniform1f data.\nShould generalize function to accept any uniform\ndata type."],class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:282,description:"<p>Basic fill material for geometry with a given color</p>\n",itemtype:"method",name:"fill",params:[{name:"v1",description:"<p>gray value,\nred or hue value (depending on the current color mode),\nor color Array, or CSS color string</p>\n",type:"Number|Array|String|p5.Color"},{name:"v2",description:"<p>optional: green or saturation value</p>\n",type:"Number",optional:!0},{name:"v3",description:"<p>optional: blue or brightness value</p>\n",type:"Number",optional:!0},{name:"a",description:"<p>optional: opacity</p>\n",type:"Number",optional:!0}],chainable:1,example:["\n<div>\n<code>\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\n\nfunction draw(){\n background(0);\n fill(250, 0, 0);\n rotateX(frameCount * 0.01);\n rotateY(frameCount * 0.01);\n rotateZ(frameCount * 0.01);\n box(200, 200, 200);\n}\n</code>\n</div>"],alt:"red canvas",class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:359,description:"<p>[strokeWeight description]</p>\n",params:[{name:"pointSize",description:"<p>stroke point size</p>\n",type:"Number"}],chainable:1,todo:["strokeWeight currently works on points only.\nimplement on all wireframes and strokes."],class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:382,description:"<p>[resize description]</p>\n",params:[{name:"w",description:"<p>[description]</p>\n",type:"Number"},{name:"h",description:"<p>[description]</p>\n",type:"Number"}],class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:398,description:"<p>clears color and depth buffers\nwith r,g,b,a</p>\n",params:[{name:"r",description:"<p>normalized red val.</p>\n",type:"Number"},{name:"g",description:"<p>normalized green val.</p>\n",type:"Number"},{name:"b",description:"<p>normalized blue val.</p>\n",type:"Number"},{name:"a",description:"<p>normalized alpha val.</p>\n",type:"Number"}],class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:415,description:"<p>[translate description]</p>\n",params:[{name:"x",description:"<p>[description]</p>\n",type:"Number"},{name:"y",description:"<p>[description]</p>\n",type:"Number"},{name:"z",description:"<p>[description]</p>\n",type:"Number"}],chainable:1,todo:["implement handle for components or vector as args"],class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:428,description:"<p>Scales the Model View Matrix by a vector</p>\n",params:[{name:"x",description:"<p>[description]</p>\n",type:"Number | p5.Vector | Array"},{name:"y",description:"<p>y-axis scalar</p>\n",type:"Number",optional:!0},{name:"z",description:"<p>z-axis scalar</p>\n",type:"Number",optional:!0}],chainable:1,class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:460,description:"<p>pushes a copy of the model view matrix onto the\nMV Matrix stack.</p>\n",class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/p5.RendererGL.js",line:468,description:"<p>[pop description]</p>\n",class:"p5.RendererGL",module:"Lights, Camera"},{file:"src/webgl/primitives.js",line:13,description:"<p>Draw a plane with given a width and height</p>\n",itemtype:"method",name:"plane",params:[{name:"width",description:"<p>width of the plane</p>\n",type:"Number"},{name:"height",description:"<p>height of the plane</p>\n",type:"Number"},{name:"detailX",description:"<p>Optional number of triangle\n subdivisions in x-dimension</p>\n",type:"Number",optional:!0},{name:"detailY",description:"<p>Optional number of triangle\n subdivisions in y-dimension</p>\n",type:"Number",optional:!0}],return:{description:"the p5 object",type:"P5"},example:["\n<div>\n<code>\n//draw a plane with width 200 and height 200\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\n\nfunction draw(){\n background(200);\n plane(50, 50);\n}\n</code>\n</div>"],alt:"Nothing displayed on canvas\nRotating interior view of a box with sides that change color.\n3d red and green gradient.\nRotating interior view of a cylinder with sides that change color.\nRotating view of a cylinder with sides that change color.\n3d red and green gradient.\nrotating view of a multi-colored cylinder with concave sides.",class:"p5",module:"Shape",submodule:"3D Primitives"},{file:"src/webgl/primitives.js",line:86,description:"<p>Draw a box with given width, height and depth</p>\n",itemtype:"method",name:"box",params:[{name:"width",description:"<p>width of the box</p>\n",type:"Number"},{name:"Height",description:"<p>height of the box</p>\n",type:"Number",optional:!0},{name:"depth",description:"<p>depth of the box</p>\n",type:"Number",optional:!0},{name:"detailX",description:"<p>Optional number of triangle\n subdivisions in x-dimension</p>\n",type:"Number",optional:!0},{name:"detailY",description:"<p>Optional number of triangle\n subdivisions in y-dimension</p>\n",type:"Number",optional:!0}],chainable:1,example:["\n<div>\n<code>\n//draw a spinning box with width, height and depth 200\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\n\nfunction draw(){\n background(200);\n rotateX(frameCount * 0.01);\n rotateY(frameCount * 0.01);\n box(200, 200, 200);\n}\n</code>\n</div>"],class:"p5",module:"Shape",submodule:"3D Primitives"},{file:"src/webgl/primitives.js",line:171,description:"<p>Draw a sphere with given radius</p>\n",itemtype:"method",name:"sphere",params:[{name:"radius",description:"<p>radius of circle</p>\n",type:"Number"},{name:"detailX",description:"<p>optional: number of segments,\n the more segments the smoother geometry\n default is 24</p>\n",type:"Number",optional:!0},{name:"detailY",description:"<p>optional: number of segments,\n the more segments the smoother geometry\n default is 16</p>\n",type:"Number",optional:!0}],chainable:1,example:["\n<div>\n<code>\n// draw a sphere with radius 200\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\n\nfunction draw(){\n background(200);\n sphere(50);\n}\n</code>\n</div>"],class:"p5",module:"Shape",submodule:"3D Primitives"},{file:"src/webgl/primitives.js",line:237,access:"private",tagname:"helper function for creating both cones and cyllinders",class:"p5",module:"Shape",submodule:"3D Primitives"},{file:"src/webgl/primitives.js",line:315,description:"<p>Draw a cylinder with given radius and height</p>\n",itemtype:"method",name:"cylinder",params:[{name:"radius",description:"<p>radius of the surface</p>\n",type:"Number"},{name:"height",description:"<p>height of the cylinder</p>\n",type:"Number"},{name:"detailX",description:"<p>optional: number of segments,\n the more segments the smoother geometry\n default is 24</p>\n",type:"Number",optional:!0},{name:"detailY",description:"<p>optional: number of segments in y-dimension,\n the more segments the smoother geometry\n default is 16</p>\n",type:"Number",optional:!0}],chainable:1,example:["\n<div>\n<code>\n//draw a spinning cylinder with radius 200 and height 200\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\n\nfunction draw(){\n background(200);\n rotateX(frameCount * 0.01);\n rotateZ(frameCount * 0.01);\n cylinder(200, 200);\n}\n</code>\n</div>"],class:"p5",module:"Shape",submodule:"3D Primitives"},{file:"src/webgl/primitives.js",line:374,description:"<p>Draw a cone with given radius and height</p>\n",itemtype:"method",name:"cone",params:[{name:"radius",description:"<p>radius of the bottom surface</p>\n",type:"Number"},{name:"height",description:"<p>height of the cone</p>\n",type:"Number"},{name:"detailX",description:"<p>optional: number of segments,\n the more segments the smoother geometry\n default is 24</p>\n",type:"Number",optional:!0},{name:"detailY",description:"<p>optional: number of segments,\n the more segments the smoother geometry\n default is 16</p>\n",type:"Number",optional:!0}],chainable:1,example:["\n<div>\n<code>\n//draw a spinning cone with radius 200 and height 200\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\n\nfunction draw(){\n background(200);\n rotateX(frameCount * 0.01);\n rotateZ(frameCount * 0.01);\n cone(200, 200);\n}\n</code>\n</div>"],class:"p5",module:"Shape",submodule:"3D Primitives"},{file:"src/webgl/primitives.js",line:434,description:"<p>Draw an ellipsoid with given radius</p>\n",itemtype:"method",name:"ellipsoid",params:[{name:"radiusx",description:"<p>xradius of circle</p>\n",type:"Number"},{name:"radiusy",description:"<p>yradius of circle</p>\n",type:"Number"},{name:"radiusz",description:"<p>zradius of circle</p>\n",type:"Number"},{name:"detailX",description:"<p>optional: number of segments,\n the more segments the smoother geometry\n default is 24. Avoid detail number above\n 150, it may crash the browser.</p>\n",type:"Number",optional:!0},{name:"detailY",description:"<p>optional: number of segments,\n the more segments the smoother geometry\n default is 16. Avoid detail number above\n 150, it may crash the browser.</p>\n",type:"Number",optional:!0}],chainable:1,example:["\n<div>\n<code>\n// draw an ellipsoid with radius 20, 30 and 40.\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\n\nfunction draw(){\n background(200);\n ellipsoid(20, 30, 40);\n}\n</code>\n</div>"],class:"p5",module:"Shape",submodule:"3D Primitives"},{file:"src/webgl/primitives.js",line:508,description:"<p>Draw a torus with given radius and tube radius</p>\n",itemtype:"method",name:"torus",params:[{name:"radius",description:"<p>radius of the whole ring</p>\n",type:"Number"},{name:"tubeRadius",description:"<p>radius of the tube</p>\n",type:"Number"},{name:"detailX",description:"<p>optional: number of segments in x-dimension,\n the more segments the smoother geometry\n default is 24</p>\n",type:"Number",optional:!0},{name:"detailY",description:"<p>optional: number of segments in y-dimension,\n the more segments the smoother geometry\n default is 16</p>\n",type:"Number",optional:!0}],chainable:1,example:["\n<div>\n<code>\n//draw a spinning torus with radius 200 and tube radius 60\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\n\nfunction draw(){\n background(200);\n rotateX(frameCount * 0.01);\n rotateY(frameCount * 0.01);\n torus(200, 60);\n}\n</code>\n</div>"],class:"p5",module:"Shape",submodule:"3D Primitives"},{file:"src/webgl/primitives.js",line:790,description:"<p>Draw a line given two points</p>\n",params:[{name:"x0",description:"<p>x-coordinate of first vertex</p>\n",type:"Number"},{name:"y0",description:"<p>y-coordinate of first vertex</p>\n",type:"Number"},{name:"z0",description:"<p>z-coordinate of first vertex</p>\n",type:"Number"},{name:"x1",description:"<p>x-coordinate of second vertex</p>\n",type:"Number"},{name:"y1",description:"<p>y-coordinate of second vertex</p>\n",type:"Number"},{name:"z1",description:"<p>z-coordinate of second vertex</p>\n",type:"Number"}],chainable:1,example:["\n<div>\n<code>\n//draw a line\nfunction setup(){\n createCanvas(100, 100, WEBGL);\n}\n\nfunction draw(){\n background(200);\n rotateX(frameCount * 0.01);\n rotateY(frameCount * 0.01);\n // Use fill instead of stroke to change the color of shape.\n fill(255, 0, 0);\n line(10, 10, 0, 60, 60, 20);\n}\n</code>\n</div>"],class:"p5",module:"Shape",submodule:"3D Primitives"},{file:"lib/addons/p5.dom.js",line:41,description:"<p>Searches the page for an element with the given ID, class, or tag name (using the '#' or '.'\nprefixes to specify an ID or class respectively, and none for a tag) and returns it as\na p5.Element. If a class or tag name is given with more than 1 element,\nonly the first element will be returned.\nThe DOM node itself can be accessed with .elt.\nReturns null if none found. You can also specify a container to search within.</p>\n",itemtype:"method",name:"select",params:[{name:"name",description:"<p>id, class, or tag name of element to search for</p>\n",type:"String"},{name:"container",description:"<p>id, p5.Element, or HTML element to search within</p>\n",type:"String",optional:!0}],return:{description:"p5.Element containing node found",type:"Object|p5.Element|Null"},example:["\n<div ><code class='norender'>\nfunction setup() {\n createCanvas(100,100);\n //translates canvas 50px down\n select('canvas').position(100, 100);\n}\n</code></div>\n<div ><code class='norender'>\n// these are all valid calls to select()\nvar a = select('#moo');\nvar b = select('#blah', '#myContainer');\nvar c = select('#foo', b);\nvar d = document.getElementById('beep');\nvar e = select('p', d);\n</code></div>\n"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:100,description:"<p>Searches the page for elements with the given class or tag name (using the '.' prefix\nto specify a class and no prefix for a tag) and returns them as p5.Elements\nin an array.\nThe DOM node itself can be accessed with .elt.\nReturns an empty array if none found.\nYou can also specify a container to search within.</p>\n",itemtype:"method",name:"selectAll",params:[{name:"name",description:"<p>class or tag name of elements to search for</p>\n",type:"String"},{name:"container",description:"<p>id, p5.Element, or HTML element to search within</p>\n",type:"String",optional:!0}],return:{description:"Array of p5.Elements containing nodes found",type:"Array"},example:["\n<div class='norender'><code>\nfunction setup() {\n createButton('btn');\n createButton('2nd btn');\n createButton('3rd btn');\n var buttons = selectAll('button');\n\n for (var i = 0; i < buttons.length; i++){\n buttons[i].size(100,100);\n }\n}\n</code></div>\n<div class='norender'><code>\n// these are all valid calls to selectAll()\nvar a = selectAll('.moo');\nvar b = selectAll('div');\nvar c = selectAll('button', '#myContainer');\nvar d = select('#container');\nvar e = selectAll('p', d);\nvar f = document.getElementById('beep');\nvar g = select('.blah', f);\n</code></div>\n"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:156,description:"<p>Helper function for select and selectAll</p>\n",class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:172,description:"<p>Helper function for getElement and getElements.</p>\n",class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:199,description:"<p>Removes all elements created by p5, except any canvas / graphics\nelements created by createCanvas or createGraphics.\nEvent handlers are removed, and element is removed from the DOM.</p>\n",itemtype:"method",name:"removeElements",example:["\n<div class='norender'><code>\nfunction setup() {\n createCanvas(100, 100);\n createDiv('this is some text');\n createP('this is a paragraph');\n}\nfunction mousePressed() {\n removeElements(); // this will remove the div and p, not canvas\n}\n</code></div>\n"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:225,description:"<p>Helpers for create methods.</p>\n",class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:236,description:"<p>Creates a <div></div> element in the DOM with given inner HTML.\nAppends to the container node if one is specified, otherwise\nappends to body.</p>\n",itemtype:"method",name:"createDiv",params:[{name:"html",description:"<p>inner HTML for element created</p>\n",type:"String",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div class='norender'><code>\nvar myDiv;\nfunction setup() {\n myDiv = createDiv('this is some text');\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:253,description:"<p>Creates a <p></p> element in the DOM with given inner HTML. Used\nfor paragraph length text.\nAppends to the container node if one is specified, otherwise\nappends to body.</p>\n",itemtype:"method",name:"createP",params:[{name:"html",description:"<p>inner HTML for element created</p>\n",type:"String",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div class='norender'><code>\nvar myP;\nfunction setup() {\n myP = createP('this is some text');\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:271,description:"<p>Creates a <span></span> element in the DOM with given inner HTML.\nAppends to the container node if one is specified, otherwise\nappends to body.</p>\n",itemtype:"method",name:"createSpan",params:[{name:"html",description:"<p>inner HTML for element created</p>\n",type:"String",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div class='norender'><code>\nvar mySpan;\nfunction setup() {\n mySpan = createSpan('this is some text');\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:297,description:"<p>Creates an <img> element in the DOM with given src and\nalternate text.\nAppends to the container node if one is specified, otherwise\nappends to body.</p>\n",itemtype:"method",name:"createImg",params:[{name:"src",description:"<p>src path or url for image</p>\n",type:"String"},{name:"alt",description:"<p>alternate text to be used if image does not load</p>\n",type:"String",optional:!0},{name:"successCallback",description:"<p>callback to be called once image data is loaded</p>\n",type:"Function",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div class='norender'><code>\nvar img;\nfunction setup() {\n img = createImg('http://p5js.org/img/asterisk-01.png');\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:342,description:"<p>Creates an <a></a> element in the DOM for including a hyperlink.\nAppends to the container node if one is specified, otherwise\nappends to body.</p>\n",itemtype:"method",name:"createA",params:[{name:"href",description:"<p>url of page to link to</p>\n",type:"String"},{name:"html",description:"<p>inner html of link element to display</p>\n",type:"String"},{name:"target",description:"<p>target where new link should open,\n could be _blank, _self, _parent, _top.</p>\n",type:"String",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div class='norender'><code>\nvar myLink;\nfunction setup() {\n myLink = createA('http://p5js.org/', 'this is a link');\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:369,class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:372,description:"<p>Creates a slider <input></input> element in the DOM.\nUse .size() to set the display length of the slider.\nAppends to the container node if one is specified, otherwise\nappends to body.</p>\n",itemtype:"method",name:"createSlider",params:[{name:"min",description:"<p>minimum value of the slider</p>\n",type:"Number"},{name:"max",description:"<p>maximum value of the slider</p>\n",type:"Number"},{name:"value",description:"<p>default value of the slider</p>\n",type:"Number",optional:!0},{name:"step",description:"<p>step size for each tick of the slider (if step is set to 0, the slider will move continuously from the minimum to the maximum value)</p>\n",type:"Number",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div><code>\nvar slider;\nfunction setup() {\n slider = createSlider(0, 255, 100);\n slider.position(10, 10);\n slider.style('width', '80px');\n}\n\nfunction draw() {\n var val = slider.value();\n background(val);\n}\n</code></div>\n\n<div><code>\nvar slider;\nfunction setup() {\n colorMode(HSB);\n slider = createSlider(0, 360, 60, 40);\n slider.position(10, 10);\n slider.style('width', '80px');\n}\n\nfunction draw() {\n var val = slider.value();\n background(val, 100, 100, 1);\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:428,description:"<p>Creates a <button></button> element in the DOM.\nUse .size() to set the display size of the button.\nUse .mousePressed() to specify behavior on press.\nAppends to the container node if one is specified, otherwise\nappends to body.</p>\n",itemtype:"method",name:"createButton",params:[{name:"label",description:"<p>label displayed on the button</p>\n",type:"String"},{name:"value",description:"<p>value of the button</p>\n",type:"String",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div class='norender'><code>\nvar button;\nfunction setup() {\n createCanvas(100, 100);\n background(0);\n button = createButton('click me');\n button.position(19, 19);\n button.mousePressed(changeBG);\n}\n\nfunction changeBG() {\n var val = random(255);\n background(val);\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:463,description:"<p>Creates a checkbox <input></input> element in the DOM.\nCalling .checked() on a checkbox returns if it is checked or not</p>\n",itemtype:"method",name:"createCheckbox",params:[{name:"label",description:"<p>label displayed after checkbox</p>\n",type:"String",optional:!0},{name:"value",description:"<p>value of the checkbox; checked is true, unchecked is false.Unchecked if no value given</p>\n",type:"Boolean",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div class='norender'><code>\nvar checkbox;\n\nfunction setup() {\n checkbox = createCheckbox('label', false);\n checkbox.changed(myCheckedEvent);\n}\n\nfunction myCheckedEvent() {\n if (this.checked()) {\n console.log(\"Checking!\");\n } else {\n console.log(\"Unchecking!\");\n }\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:528,description:"<p>Creates a dropdown menu <select></select> element in the DOM.\nIt also helps to assign select-box methods to p5.Element when selecting existing select box</p>\n",itemtype:"method",name:"createSelect",return:{description:"",type:"p5.Element"},example:["\n<div><code>\nvar sel;\n\nfunction setup() {\n textAlign(CENTER);\n background(200);\n sel = createSelect();\n sel.position(10, 10);\n sel.option('pear');\n sel.option('kiwi');\n sel.option('grape');\n sel.changed(mySelectEvent);\n}\n\nfunction mySelectEvent() {\n var item = sel.value();\n background(200);\n text(\"it's a \"+item+\"!\", 50, 50);\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom",overloads:[{line:528,params:[{name:"multiple",description:"<p>true if dropdown should support multiple selections</p>\n",type:"Boolean",optional:!0}],return:{description:"",type:"p5.Element"}},{line:556,params:[{name:"existing",description:"<p>DOM select element</p>\n",type:"Object"}],return:{description:"",type:"p5.Element"}}]},{file:"lib/addons/p5.dom.js",line:633,description:"<p>Creates a radio button <input></input> element in the DOM.\nThe .option() method can be used to set options for the radio after it is\ncreated. The .value() method will return the currently selected option.</p>\n",itemtype:"method",name:"createRadio",params:[{name:"divId",description:"<p>the id and name of the created div and input field respectively</p>\n",type:"String",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div><code>\nvar radio;\n\nfunction setup() {\n radio = createRadio();\n radio.option(\"black\");\n radio.option(\"white\");\n radio.option(\"gray\");\n radio.style('width', '60px');\n textAlign(CENTER);\n fill(255, 0, 0);\n}\n\nfunction draw() {\n var val = radio.value();\n background(val);\n text(val, width/2, height/2);\n}\n</code></div>\n<div><code>\nvar radio;\n\nfunction setup() {\n radio = createRadio();\n radio.option('apple', 1);\n radio.option('bread', 2);\n radio.option('juice', 3);\n radio.style('width', '60px');\n textAlign(CENTER);\n}\n\nfunction draw() {\n background(200);\n var val = radio.value();\n if (val) {\n text('item cost is $'+val, width/2, height/2);\n }\n}\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:759,description:"<p>Creates an <input></input> element in the DOM for text input.\nUse .size() to set the display length of the box.\nAppends to the container node if one is specified, otherwise\nappends to body.</p>\n",itemtype:"method",name:"createInput",params:[{name:"value",description:"<p>default value of the input box</p>\n",type:"Number",optional:!0},{name:"type",description:"<p>type of text, ie text, password etc. Defaults to text</p>\n",type:"String",optional:!0}],return:{description:"pointer to p5.Element holding created node",type:"Object|p5.Element"},example:["\n<div class='norender'><code>\nfunction setup(){\n var inp = createInput('');\n inp.input(myInputEvent);\n}\n\nfunction myInputEvent(){\n console.log('you are typing: ', this.value());\n}\n\n</code></div>"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:789,description:"<p>Creates an <input></input> element in the DOM of type 'file'.\nThis allows users to select local files for use in a sketch.</p>\n",itemtype:"method",name:"createFileInput",params:[{name:"callback",description:"<p>callback function for when a file loaded</p>\n",type:"Function",optional:!0},{name:"multiple",description:"<p>optional to allow multiple files selected</p>\n",type:"String",optional:!0}],return:{description:"pointer to p5.Element holding created DOM element",type:"Object|p5.Element"},example:["\nvar input;\nvar img;\n\nfunction setup() {\n input = createFileInput(handleFile);\n input.position(0, 0);\n}\n\nfunction draw() {\n if (img) {\n image(img, 0, 0, width, height);\n }\n}\n\nfunction handleFile(file) {\n print(file);\n if (file.type === 'image') {\n img = createImg(file.data);\n img.hide();\n }\n}"],class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:874,class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:911,description:'<p>Creates an HTML5 <video> element in the DOM for simple playback\nof audio/video. Shown by default, can be hidden with .hide()\nand drawn into canvas using video(). Appends to the container\nnode if one is specified, otherwise appends to body. The first parameter\ncan be either a single string path to a video file, or an array of string\npaths to different formats of the same video. This is useful for ensuring\nthat your video can play across different browsers, as each supports\ndifferent formats. See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats">this\npage</a> for further information about supported formats.</p>\n',itemtype:"method",name:"createVideo",params:[{name:"src",description:"<p>path to a video file, or array of paths for\n supporting different browsers</p>\n",type:"String|Array"},{name:"callback",description:"<p>callback function to be called upon\n 'canplaythrough' event fire, that is, when the\n browser can play the media, and estimates that\n enough data has been loaded to play the media\n up to its end without having to stop for\n further buffering of content</p>\n",type:"Object",optional:!0}],return:{description:"pointer to video p5.Element",type:"p5.MediaElement|p5.Element"},class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:937,class:"p5.dom",module:"p5.dom",submodule:"p5.dom"},{file:"lib/addons/p5.dom.js",line:939, +description:'<p>Creates a hidden HTML5 <audio> element in the DOM for simple audio\nplayback. Appends to the container node if one is specified,\notherwise appends to body. The first parameter\ncan be either a single string path to a audio file, or an array of string\npaths to different formats of the same audio. This is useful for ensuring\nthat your audio can play across different browsers, as each supports\ndifferent formats. See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats">this\npage for further information about supported formats</a>.</p>\n',itemtype:"method",name:"createAudio",params:[{name:"src",description:"<p>path to an audio file, or array of paths for\n supporting different browsers</p>°äŒf +description:'<p>List the SoundFile formats that you will include. LoadSound\nwill search your directory for these extensions, and will pick\na format that is compatable with the client's web browser.\n<a href="http://media.io/">Here</a> is a free online file\nconverter.</p>\n',itemtype:"method",name:"soundFormats",params:[{name:"formats",description:"<p>i.e. 'mp3', 'wav', 'ogg'</p>\n",type:"String",optional:!0,multiple:!0}],example:["\n<div><code>\nfunction preload() {\n // set the global sound formats\n soundFormats('mp3', 'ogg');\n\n // load either beatbox.mp3, or .ogg, depending on browser\n mySound = loadSound('assets/beatbox.mp3');\n}\n\nfunction setup() {\n mySound.play();\n}\n</code></div>"],class:"p5",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:584,description:"<p>Used by Osc and Env to chain signal math</p>\n",class:"p5",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:869,description:'<p>loadSound() returns a new p5.SoundFile from a specified\npath. If called during preload(), the p5.SoundFile will be ready\nto play in time for setup() and draw(). If called outside of\npreload, the p5.SoundFile will not be ready immediately, so\nloadSound accepts a callback as the second parameter. Using a\n<a href="https://github.com/processing/p5.js/wiki/Local-server">\nlocal server</a> is recommended when loading external files.</p>\n',itemtype:"method",name:"loadSound",params:[{name:"path",description:"<p>Path to the sound file, or an array with\n paths to soundfiles in multiple formats\n i.e. ['sound.ogg', 'sound.mp3'].\n °äŒf +example:['\n<div><code>\n\n\nfunction setup(){\ncnv = createCanvas(800,400);\nsound = new p5.AudioIn();\nsound.start();\nfft = new p5.FFT();\nsound.connect(fft);\n}\n\n\nfunction draw(){\n\nvar centroidplot = 0.0;\nvar spectralCentroid = 0;\n\n\nbackground(0);\nstroke(0,255,0);\nvar spectrum = fft.analyze();\nfill(0,255,0); // spectrum is green\n\n//draw the spectrum\n\nfor (var i = 0; i< spectrum.length; i++){\n var x = map(log(i), 0, log(spectrum.length), 0, width);\n var h = map(spectrum[i], 0, 255, 0, height);\n var rectangle_width = (log(i+1)-log(i))*(width/log(spectrum.length));\n rect(x, height, rectangle_width, -h )\n}\n\nvar nyquist = 22050;\n\n// get the centroid\nspectralCentroid = fft.getCentroid();\n\n// the mean_freq_index calculation is for the display.\nvar mean_freq_index = spectralCentroid/(nyquist/spectrum.length);\n\ncentroidplot = map(log(mean_freq_index), 0, log(spectrum.length), 0, width);\n\n\nstroke(255,0,0); // the line showing where the centroid is will be red\n\nrect(centroidplot, 0, width / spectrum.length, height)\nnoStroke();\nfill(255,255,255); // text is white\ntextSize(40);\ntext("centroid: "+round(spectralCentroid)+" Hz", 10, 40);\n}\n </code></div>'],class:"p5.FFT",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:2886,description:"<p>Smooth FFT analysis by averaging with the last analysis frame.</p>\n",itemtype:"method",name:"smooth",params:[{name:"smoothing",description:"<p>0.0 < smoothing < 1.0.\n Defaults to 0.8.</p>\n",type:"Number"}],class:"p5.FFT",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:2906,description:"<p>Returns an array of average amplitude values for a given number\nof frequency bands split equally. N defaults to 16.\n<em>NOTE: analyze() must be called prior to linAverages(). Analyze()\ntells the FFT to analyze frequency data, and linAverages() uses\nthe results to group them into a smaller set of averages.</em></p></p>\n",itemtype:"method",name:"linAverages",params:[{name:"N",description:"<p>Number of returned frequency groups</p>\n",type:"Number"}],return:{description:"linearAverages Array of average amplitude values for each group",type:"Array"},class:"p5.FFT",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:2936,description:'<p>Returns an array of average amplitude values of the spectrum, for a given\nset of <a href="https://en.wikipedia.org/wiki/Octave_band" target="_blank">\nOctave Bands</a>\n<em>NOTE: analyze() must be called prior to logAverages(). Analyze()\ntells the FFT to analyze frequency data, and logAverages() uses\nthe results to group them into a smaller set of averages.</em></p></p>\n',itemtype:"method",name:"logAverages",params:[{name:"octaveBands",description:"<p>Array of Octave Bands objects for grouping</p>\n",type:"Array"}],return:{description:"logAverages Array of average amplitude values for each group",type:"Array"},class:"p5.FFT",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:2966,description:'<p>Calculates and Returns the 1/N\n<a href="https://en.wikipedia.org/wiki/Octave_band" target="_blank">Octave Bands</a>\nN defaults to 3 and minimum central frequency to 15.625Hz.\n(1/3 Octave Bands ~= 31 Frequency Bands)\nSetting fCtr0 to a central value of a higher octave will °äŒf +description:"<p>Name of a function to call on\n success.</p>\n",type:"Function",optional:!0},{name:"errorCallback",description:"<p>Name of a function to call if\n there was an error. For example,\n some browsers do not support\n getUserMedia.</p>\n",type:"Function",optional:!0}],class:"p5.AudioIn",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:6571,description:"<p>Turn the AudioIn off. If the AudioIn is stopped, it cannot getLevel().\nIf re-starting, the user may be prompted for permission access.</p>\n",itemtype:"method",name:"stop",class:"p5.AudioIn",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:6583,description:"<p>Connect to an audio unit. If no parameter is provided, will\nconnect to the master output (i.e. your speakers).<br/></p>\n",itemtype:"method",name:"connect",params:[{name:"unit",description:"<p>An object that accepts audio input,\n such as an FFT</p>\n",type:"Object",optional:!0}],class:"p5.AudioIn",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:6604,description:"<p>Disconnect the AudioIn from all audio units. For example, if\nconnect() had been called, disconnect() will stop sending\nsignal to your speakers.<br/></p>\n",itemtype:"method",name:"disconnect",class:"p5.AudioIn",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:6616,description:"<p>Read the Amplitude (volume level) of an AudioIn. The AudioIn\nclass contains its own instance of the Amplitude class to help\nmake it easy to get a microphone's volume level. Accepts an\noptional smoothing value (0.0 < 1.0). <em>NOTE: AudioIn must\n.start() before using .getLevel().</em><br/></p>\n",itemtype:"method",name:"getLevel",params:[{name:"smoothing",description:"<p>Smoothing is 0.0 by default.\n Smooths values based on previous values.</p>\n",type:"Number",optional:!0}],return:{description:"Volume level (between 0.0 and 1.0)",type:"Number"},class:"p5.AudioIn",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:6634,description:"<p>Add input sources to the list of available sources.</p>\n",access:"private",tagname:"",class:"p5.AudioIn",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:6649,description:"<p>Set amplitude (volume) of a mic input between 0 and 1.0. <br/></p>\n",itemtype:"method",name:"amp",params:[{name:"vol",description:"<p>between 0 and 1.0</p>\n",type:"Number"},{name:"time",description:"<p>ramp time (optional)</p>\n",type:"Number",optional:!0}],class:"p5.AudioIn",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:6677,description:'<p>Chrome only. Returns a list of available input sources\nand allows the user to set the media source. Firefox allows\nthe user to choose from input sources in the permissions dialogue\ninstead of enumerating available sources and selecting one.\nNote: in order to have descriptive media names your page must be\nserved over a secure (HTTPS) connection and the page should\nrequest user media before enumerating devices. Otherwise device\nID will be a long device ID number and does not specify device\ntype. For example see\n<a href="https://simpl.info/getusermedia/sources/index.html">https://simpl.info/getusermedia/sources/index.html</a> vs.\n<a href="http://simpl.info/getusermedia/sources/index.html">http://simpl.info/getusermedia/sources/index.html</a></p>\n',itemtype:"method",name:"getSources",params:[{name:"callback",description:"<p>a callback to handle the sources\n when they have been enumerated</p>\n",type:"Function"}],example:["\n <div><code>\n var audiograb;\n\n function setup(){\n //new audioIn\n audioGrab = new p5.AudioIn();\n\n audioGrab.getSources(function(sourceList) {\n //print out the array of available sources\n console.log(sourceList);\n //set the source to the first item in the inputSources array\n audioGrab.setSou°äŒf +description:'<p>The p5.Compressor is built with a <a href="https://www.w3.org/TR/webaudio/#the-dynamicscompressornode-interface" \n target="_blank" title="W3 spec for Dynamics Compressor Node">Web Audio Dynamics Compressor Node\n </a></p>\n',itemtype:"property",name:"compressor",type:"WebAudioNode",class:"p5.Compressor",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:9578,description:"<p>Performs the same function as .connect, but also accepts\noptional parameters to set compressor's audioParams</p>\n",itemtype:"method",name:"process",params:[{name:"src",description:"<p>Sound source to be connected</p>\n",type:"Object"},{name:"attack",description:"<p>The amount of time (in seconds) to reduce the gain by 10dB,\n default = .003, range 0 - 1</p>\n",type:"Number",optional:!0},{name:"knee",description:"<p>A decibel value representing the range above the \n threshold where the curve smoothly transitions to the "ratio" portion.\n default = 30, range 0 - 40</p>\n",type:"Number",optional:!0},{name:"ratio",description:"<p>The amount of dB change in input for a 1 dB change in output\n default = 12, range 1 - 20</p>\n",type:"Number",optional:!0},{name:"threshold",description:"<p>The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0</p>\n",type:"Number",optional:!0},{name:"release",description:"<p>The amount of time (in seconds) to increase the gain by 10dB\n default = .25, range 0 - 1</p>\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:9601,description:"<p>Set the paramters of a compressor.</p>\n",itemtype:"method",name:"set",params:[{name:"attack",description:"<p>The amount of time (in seconds) to reduce the gain by 10dB,\n default = .003, range 0 - 1</p>\n",type:"Number"},{name:"knee",description:"<p>A decibel value representing the range above the \n threshold where the curve smoothly transitions to the "ratio" portion.\n default = 30, range 0 - 40</p>\n",type:"Number"},{name:"ratio",description:"<p>The amount of dB change in input for a 1 dB change in output\n default = 12, range 1 - 20</p>\n",type:"Number"},{name:"threshold",description:"<p>The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0</p>\n",type:"Number"},{name:"release",description:"<p>The amount of time (in seconds) to increase the gain by 10dB\n default = .25, range 0 - 1</p>\n",type:"Number"}],class:"p5.Compressor",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:9633,description:"<p>Get current attack or set value w/ time ramp</p>\n",itemtype:"method",name:"attack",params:[{name:"attack",description:"<p>Attack is the amount of time (in seconds) to reduce the gain by 10dB,\n default = .003, range 0 - 1</p>\n",type:"Number",optional:!0},{name:"time",description:"<p>Assign time value to schedule the change in value</p>\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:9653,description:"<p>Get current knee or set value w/ time ramp</p>\n",itemtype:"method",name:"knee",params:[{name:"knee",description:"<p>A decibel value representing the range above the \n threshold where the curve smoothly transitions to the "ratio" portion.\n default = 30, range 0 - 40</p>\n",type:"Number",optional:!0},{name:"time",description:"<p>Assign time value to schedule the change in value</p>\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:9673,description:"<p>Get current ratio or set value w/ time ramp</p>\n",itemtype:"method",name:"ratio",params:[{name:"ratio",description:"<p>The amount of dB change in input for a 1 dB change in output\n default = 12, range 1 - 20</p>\n",type:"Number",optional:!0},{name:"time",description:"<p>Assign time value to schedule the change in value</p>\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:9692,description:"<p>Get current threshold or set value w/ time ramp</p>\n",itemtype:"method",name:"threshold",params:[{name:"threshold",description:"<p>The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0</p>\n",type:"Number"},{name:"time",description:"<p>Assign time value to schedule the change in value</p>\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound",submodule:"p5.sound"},{file:"lib/addons/p5.sound.js",line:9711,description:"<p>Get current release°äŒf +message:"Missing item type\nConvert an HSBA array to RGBA.",line:" src/color/color_conversion.js:46"},{message:"Missing item type\nConvert an HSLA array to HSBA.",line:" src/color/color_conversion.js:95"},{message:"Missing item type\nConvert an HSLA array to RGBA.\n\nWe need to change basis from HSLA to something that can be more easily be\nprojected onto RGBA. We will choose hue and brightness as our first two\ncomponents, and pick a convenient third one ('zest') so that we don't need\nto calculate formal HSBA saturation.",line:" src/color/color_conversion.js:118"},{message:"Missing item type\nConvert an RGBA array to HSBA.",line:" src/color/color_conversion.js:176"},{message:"Missing item type\nConvert an RGBA array to HSLA.",line:" src/color/color_conversion.js:211"},{message:"Missing item type\nHue is the same in HSB and HSL, but the maximum value may be different.\nThis function will return the HSB-normalized saturation when supplied with\nan HSB color object, but will default to the HSL-normalized saturation\notherwise.",line:" src/color/p5.Color.js:79"},{message:"Missing item type\nSaturation is scaled differently in HSB and HSL. This function will return\nthe HSB saturation when supplied with an HSB color object, but will default\nto the HSL saturation otherwise.",line:" src/color/p5.Color.js:110"},{message:"Missing item type\nCSS named colors.",line:" src/color/p5.Color.js:129"},{message:"Missing item type\nThese regular expressions are used to build up the patterns for matching\nviable CSS color strings: fragmenting the regexes in this way increases the\nlegibility and comprehensibility of the code.\n\nNote that RGB values of .9 are not parsed by IE, but are supported here for\ncolor string consistency.",line:" src/color/p5.Color.js:282"},{message:"Missing item type\nFull color string patterns. The capture groups are necessary.",line:" src/color/p5.Color.js:295"},{message:"Missing item type\nFor a number of different inputs, returns a color formatted as [r, g, b, a]\narrays, with each component normalized between 0 and 1.",line:" src/color/p5.Color.js:408"},{message:"Missing item type\nFor HSB and HSL, interpret the gray level as a brightness/lightness\nvalue (they are equivalent when chroma is zero). For RGB, normalize the\ngray level according to the blue maximum.",line:" src/color/p5.Color.js:599"},{message:"Missing item type",line:" src/core/canvas.js:1"},{message:'Missing item type\nThis is the p5 instance constructor.\n\nA p5 instance holds all the properties and methods related to\na p5 sketch. It expects an incoming sketch closure and it can also\ntake an optional node parameter for attaching the generated p5 canvas\nto a node. The sketch closure takes the newly created p5 instance as\nits sole argument and may optionally set preload(), setup(), and/or\ndraw() properties on it for running a sketch.\n\nA p5 sketch can run in "global" or "instance" mode:\n"global" - all properties and methods are attached to the window\n"instance" - all properties and methods are bound to this p5 object',line:" src/core/core.js:15"},{message:"Missing item type\nSets the resolution at which Beziers display.\n\nThe default value is 20.",line:" src/core/curves.js:99"},{message:"Missing item type\nSets the resolution at which curves display.\n\nThe default value is 20.",line:" src/core/curves.js:353"},{message:"Missing item type\nReturns the current framerate.",line:" src/core/environment.js:263"},{message:"Missing item type\nSpecifies the number of frames to be displayed every second. For example,\nthe function call frameRate(30) will attempt to refresh 30 times a second.\nIf the processor is not fast enough to maintain the specified rate, the\nframe rate will not be achieved. Setting the frame rate within setup() is\nrecommended. The default rate is 60 frames per second.\n\nCalling frameRate() with no arguments returns the current framerate.",line:" src/core/environment.js:272"},{message:"Missing item type",line:" src/core/error_helpers.js:1"},{message:"Missing item type\nPrints out a fancy, colorful message to the console log",line:" src/core/error_helpers.js:34"},{message:'Missing item type\nValidates parameters\nparam {String} func the name of the function\nparam {Array} args user input arguments\n\nexample:\n var a;\n ellipse(10,10,a,5);\nconsole ouput:\n "It looks like ellipse received an empty variable in spot #2."\n\nexample:\n ellipse(10,"foo",5,5);\nconsole output:\n "ellipse was expecting a number for parameter #1,\n received "foo" instead."',line:" src/core/error_helpers.js:106"},{message:"Missing item type\nPrints out all the colors in the color pallete with white text.\nFor color blindness testing.",line:" src/core/error_helpers.js:273"},{message:'Missing item type\n_globalInit\n\nTODO: ???\nif sketch is on window\nassume "global" mode\nand instantiate p5 automatically\notherwise do nothing',line:" src/core/init.js:5"},{message:"Missing item type\nHelper fxn for sharing pixel methods",line:" src/core/p5.Element.js:981"},{message:"Missing item type\nResize our canvas element.",line:" src/core/p5.Renderer.js:72"},{message:"Missing item type\nHelper fxn to check font type (system or otf)",line:" src/core/p5.Renderer.js:146"},{message:"Missing item type\nHelper fxn to measure ascent and descent.\nAdapted from http://stackoverflow.com/a/25355178",line:" src/core/p5.Renderer.js:202"},{message:"Missing item type\np5.Renderer2D\nThe 2D graphics canvas renderer class.\nextends p5.Renderer",line:" src/core/p5.Renderer2D.js:9"},{message:"Missing item type\nGenerate a cubic Bezier representing an arc on the unit circle of total\nangle `size` radians, beginning `start` radians above the x-axis. Up to\nfour of these curves are combined to make a full arc.\n\nSee www.joecridge.me/bezier.pdf for an explanation of the method.",line:" src/°äŒf +f=a.length-g;d<f;d+=3)e=(a[d]<<16)+(a[d+1]<<8)+a[d+2],h+=c(e);switch(g){case 1:e=a[a.length-1],h+=b(e>>2),h+=b(e<<4&63),h+="==";break;case 2:e=(a[a.length-2]<<8)+a[a.length-1],h+=b(e>>10),h+=b(e>>4&63),h+=b(e<<2&63),h+="="}return h}var e="undefined"!=typeof Uint8Array?Uint8Array:Array,f="+".charCodeAt(0),g="/".charCodeAt(0),h="0".charCodeAt(0),i="a".charCodeAt(0),j="A".charCodeAt(0),k="-".charCodeAt(0),l="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=d}(void 0===c?this.base64js={}:c)},{}],3:[function(a,b,c){},{}],4:[function(a,b,c){(function(b){"use strict";function d(){function a(){}try{var b=new Uint8Array(1);return b.foo=function(){return 42},b.constructor=a,42===b.foo()&&b.constructor===a&&"function"==typeof b.subarray&&0===b.subarray(1,1).byteLength}catch(a){return!1}}function e(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(a){return this instanceof f?(f.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof a?g(this,a):"string"==typeof a?h(this,a,arguments.length>1?arguments[1]:"utf8"):i(this,a)):arguments.length>1?new f(a,arguments[1]):new f(a)}function g(a,b){if(a=p(a,b<0?0:0|q(b)),!f.TYPED_ARRAY_SUPPORT)for(var c=0;c<b;c++)a[c]=0;return a}function h(a,b,c){return"string"==typeof c&&""!==c||(c="utf8"),a=p(a,0|s(b,c)),a.write(b,c),a}function i(a,b){if(f.isBuffer(b))return j(a,b);if(Y(b))return k(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(b.buffer instanceof ArrayBuffer)return l(a,b);if(b instanceof ArrayBuffer)return m(a,b)}return b.length?n(a,b):o(a,b)}function j(a,b){var c=0|q(b.length);return a=p(a,c),b.copy(a,0,0,c),a}function k(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;d<c;d+=1)a[d]=255&b[d];return a}function l(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;d<c;d+=1)a[d]=255&b[d];return a}function m(a,b){return f.TYPED_ARRAY_SUPPORT?(b.byteLength,a=f._augment(new Uint8Array(b))):a=l(a,new Uint8Array(b)),a}function n(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;d<c;d+=1)a[d]=255&b[d];return a}function o(a,b){var c,d=0;"Buffer"===b.type&&Y(b.data)&&(c=b.data,d=0|q(c.length)),a=p(a,d);for(var e=0;e<d;e+=1)a[e]=255&c[e];return a}function p(a,b){return f.TYPED_ARRAY_SUPPORT?(a=f._augment(new Uint8Array(b)),a.__proto__=f.prototype):(a.length=b,a._isBuffer=!0),0!==b&&b<=f.poolSize>>>1&&(a.parent=Z),a}function q(a){if(a>=e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|a}function r(a,b){if(!(this instanceof r))return new r(a,b);var c=new f(a,b);return delete c.parent,c}function s(a,b){"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"binary":case"raw":case"raws":return c;case"utf8":case"utf-8":return R(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return U(a).length;default:if(d)return R(a).length;b=(""+b).toLowerCase(),d=!0}}function t(a,b,c){var d=!1;if(b|=0,c=void 0===c||c===1/0?this.length:0|c,a||(a="utf8"),b<0&&(b=0),c>this.length&&(c=this.length),c<=b)return"";for(;;)switch(a){case"hex":return F(this,b,c);case"utf8":case"utf-8":return B(this,b,c);case"ascii":return D(this,b,c);case"binary":return E(this,b,c);case"base64":return A(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function u(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d))>e&&(d=e):d=e;var f=b.length;if(f%2!=0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;g<d;g++){var h=parseInt(b.substr(2*g,2),16);if(isNaN(h))throw new Error("Invalid hex string");a[c+g]=h}return g}function v(a,b,c,d){return V(R(b,a.length-c),a,c,d)}function w(a,b,c,d){return V(S(b),a,c,d)}function x(a,b,c,d){return w(a,b,c,d)}function y(a,b,c,d){return V(U(b),a,c,d)}function z(a,b,c,d){return V(T(b,a.length-c),a,c,d)}function A(a,b,c){return 0===b&&c===a.length?W.fromByteArray(a):W.fromByteArray(a.slice(b,c))}function B(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;e<c;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(e+h<=c){var i,j,k,l;switch(h){case 1:f<128&&(g=f);break;case 2:i=a[e+1],128==(192&i)&&(l=(31&f)<<6|63&i)>127&&(g=l);break;case 3:i=a[e+1],j=a[e+2],128==(192&i)&&128==(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j)>2047&&(l<55296||l>57343)&&(g=l);break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128==(192&i)&&128==(192&j)&&128==(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k)>65535&&l<1114112&&(g=l)}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return C(d)}function C(a){var b=a.length;if(b<=$)return String.fromCharCode.apply(String,a);for(var c="",d=0;d<b;)c+=String.fromCharCode.apply(String,a.slice(d,d+=$));return c}function D(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;e++)d+=String.fromCharCode(127&a[e]);return d}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;e++)d+=String.fromCharCode(a[e]);return d}function F(a,b,c){var d=a.length;(!b||b<0)&&(b=0),(!c||c<0||c>d)&&(c=d);for(var e="",f=b;f<c;f++)e+=Q(a[f]);return e}function G(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function H(a,b,c){if(a%1!=0||a<0)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function I(a,b,c,d,e,g){if(!f.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>e||b<g)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range")}function J(a,b,c,d){b<0&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);e<f;e++)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function K(a,b,c,d){b<0&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);e<f;e++)a[c+e]=b>>>8*(d?e:3-e)&255}function L(a,b,c,d,e,f){if(b>e||b<f)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range");if(c<0)throw new RangeError("index out of range")}function M(a,b,c,d,e){return e||L(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(a,b,c,d,23,4),c+4}function N(a,b,c,d,e){return e||L(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(a,b,c,d,52,8),c+8}function O(a){if(a=P(a).replace(aa,""),a.length<2)return"";for(;a.length%4!=0;)a+="=";return a}function P(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Q(a){return a<16?"0"+a.toString(16):a.toString(16)}function R(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;g<d;g++){if((c=a.charCodeAt(g))>55295&&c<57344){if(!e){if(c>56319){(b-=3)>-1&&f°äŒf +var i=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],j=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],k=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],l=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis"°äŒf +lb&&console.log(b.step,"MIAP["+a+"]",d,"(",i,")",e),g.setRelative(f,pb,i,h),0===b.zp0&&(f.xo=f.x,f.yo=f.y),g.touch(f),b.rp0=b.rp1=e}function la(a){var b=a.prog,c=a.ip,d=a.stack,e=b[++c];lb&&console.log(a.step,"NPUSHB[]",e);for(var f=0;f<e;f++)d.push(b[++c]);a.ip=c}function ma(a){var b=a.ip,c=a.prog,d=a.stack,e=c[++b];lb&&console.log(a.step,"NPUSHW[]",e);for(var f=0;f<e;f++){var g=c[++b]<<8|c[++b];32768&g&&(g=-(1+(65535^g))),d.push(g)}a.ip=b}function na(a){var b=a.stack,c=a.store;c||(c=a.store=[]);var d=b.pop(),e=b.pop();lb&&console.log(a.step,"WS",d,e),c[e]=d}function oa(a){var b=a.stack,c=a.store,d=b.pop();lb&&console.log(a.step,"RS",d);var e=c&&c[d]||0;b.push(e)}function pa(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"WCVTP",c,d),a.cvt[d]=c/64}function qa(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"RCVT",c),b.push(64*a.cvt[c])}function ra(a,b){var c=b.stack,d=c.pop(),e=b.z2[d];lb&&console.log(b.step,"GC["+a+"]",d),c.push(64*b.dpv.distance(e,pb,a,!1))}function sa(a,b){var c=b.stack,d=c.pop(),e=c.pop(),f=b.z1[d],g=b.z0[e],h=b.dpv.distance(g,f,a,a);lb&&console.log(b.step,"MD["+a+"]",d,e,"->",h),b.stack.push(Math.round(64*h))}function ta(a){lb&&console.log(a.step,"MPPEM[]"),a.stack.push(a.ppem)}function ua(a){lb&&console.log(a.step,"FLIPON[]"),a.autoFlip=!0}function va(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"LT[]",c,d),b.push(d<c?1:0)}function wa(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"LTEQ[]",c,d),b.push(d<=c?1:0)}function xa(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"GT[]",c,d),b.push(d>c?1:0)}function ya(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"GTEQ[]",c,d),b.push(d>=c?1:0)}function za(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"EQ[]",c,d),b.push(c===d?1:0)}function Aa(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"NEQ[]",c,d),b.push(c!==d?1:0)}function Ba(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"ODD[]",c),b.push(Math.trunc(c)%2?1:0)}function Ca(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"EVEN[]",c),b.push(Math.trunc(c)%2?0:1)}function Da(a){var b,c=a.stack.pop();lb&&console.log(a.step,"IF[]",c),c||(s(a,!0),lb&&console.log(a.step,27===b?"ELSE[]":"EIF[]"))}function Ea(a){lb&&console.log(a.step,"EIF[]")}function Fa(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"AND[]",c,d),b.push(c&&d?1:0)}function Ga(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"OR[]",c,d),b.push(c||d?1:0)}function Ha(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"NOT[]",c),b.push(c?0:1)}function Ia(a,b){var c=b.stack,d=c.pop(),e=b.fv,f=b.pv,g=b.ppem,h=b.deltaBase+16*(a-1),i=b.deltaShift,j=b.z0;lb&&console.log(b.step,"DELTAP["+a+"]",d,c);for(var k=0;k<d;k++){var l=c.pop(),m=c.pop();if(h+((240&m)>>4)===g){var n=(15&m)-8;n>=0&&n++,lb&&console.log(b.step,"DELTAPFIX",l,"by",n*i);var o=j[l];e.setRelative(o,o,n*i,f)}}}function Ja(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"SDB[]",c),a.deltaBase=c}function Ka(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"SDS[]",c),a.deltaShift=Math.pow(.5,c)}function La(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"ADD[]",c,d),b.push(d+c)}function Ma(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"SUB[]",c,d),b.push(d-c)}function Na(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"DIV[]",c,d),b.push(64*d/c)}function Oa(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"MUL[]",c,d),b.push(d*c/64)}function Pa(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"ABS[]",c),b.push(Math.abs(c))}function Qa(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"NEG[]",c),b.push(-c)}function Ra(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"FLOOR[]",c),b.push(64*Math.floor(c/64))}function Sa(a){var b=a.stack,c=b.pop();lb&&console.log(a.step,"CEILING[]",c),b.push(64*Math.ceil(c/64))}function Ta(a,b){var c=b.stack,d=c.pop();lb&&console.log(b.step,"ROUND[]"),c.push(64*b.round(d/64))}function Ua(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"WCVTF[]",c,d),a.cvt[d]=c*a.ppem/a.font.unitsPerEm}function Va(a,b){var c=b.stack,d=c.pop(),e=b.ppem,f=b.deltaBase+16*(a-1),g=b.deltaShift;lb&&console.log(b.step,"DELTAC["+a+"]",d,c);for(var h=0;h<d;h++){var i=c.pop(),j=c.pop();if(f+((240&j)>>4)===e){var k=(15&j)-8;k>=0&&k++;var l=k*g;lb&&console.log(b.step,"DELTACFIX",i,"by",l),b.cvt[i]+=l}}}function Wa(a){var b=a.stack.pop();lb&&console.log(a.step,"SROUND[]",b),a.round=mb;var c;switch(192&b){case 0:c=.5;break;case 64:c=1;break;case 128:c=2;break;default:throw new Error("invalid SROUND value")}switch(a.srPeriod=c,48&b){case 0:a.srPhase=0;break;case 16:a.srPhase=.25*c;break;case 32:a.srPhase=.5*c;break;case 48:a.srPhase=.75*c;break;default:throw new Error("invalid SROUND value")}b&=15,a.srThreshold=0===b?0:(b/8-.5)*c}function Xa(a){var b=a.stack.pop();lb&&console.log(a.step,"S45ROUND[]",b),a.round=mb;var c;switch(192&b){case 0:c=Math.sqrt(2)/2;break;case 64:c=Math.sqrt(2);break;case 128:c=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(a.srPeriod=c,48&b){case 0:a.srPhase=0;break;case 16:a.srPhase=.25*c;break;case 32:a.srPhase=.5*c;break;case 48:a.srPhase=.75*c;break;default:throw new Error("invalid S45ROUND value")}b&=15,a.srThreshold=0===b?0:(b/8-.5)*c}function Ya(a){lb&&console.log(a.step,"ROFF[]"),a.round=e}function Za(a){lb&&console.log(a.step,"RUTG[]"),a.round=i}function $a(a){lb&&console.log(a.step,"RDTG[]"),a.round=j}function _a(a){var b=a.stack.pop();lb&&console.log(a.step,"SCANCTRL[]",b)}function ab(a,b){var c=b.stack,d=c.pop(),e=c.pop(),f=b.z2[d],g=b.z1[e];lb&&console.log("SDPVTL["+a+"]",d,e);var h,i;a?(h=f.y-g.y,i=g.x-f.x):(h=g.x-f.x,i=g.y-f.y),b.dpv=l(h,i)}function bb(a){var b=a.stack,c=b.pop(),d=0;lb&&console.log(a.step,"GETINFO[]",c),1&c&&(d=35),32&c&&(d|=4096),b.push(d)}function cb(a){var b=a.stack,c=b.pop(),d=b.pop(),e=b.pop();lb&&console.log(a.step,"ROLL[]"),b.push(d),b.push(c),b.push(e)}function db(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"MAX[]",c,d),b.push(Math.max(d,c))}function eb(a){var b=a.stack,c=b.pop(),d=b.pop();lb&&console.log(a.step,"MIN[]",c,d),b.push(Math.min(d,c))}function fb(a){var b=a.stack.pop();lb&&console.log(a.step,"SCANTYPE[]",b)}function gb(a){var b=a.stack.pop(),c=a.stack.pop();switch(lb&&console.log(a.step,"INSTCTRL[]",b,c),b){case 1:return void(a.inhibitGridFit=!!c);case 2:return void(a.ignoreCvt=!!c);default:throw new Error("invalid INSTCTRL[] selector")}}function hb(a,b){var c=b.stack,d=b.prog,e=b.ip;lb&&console.log(b.step,"PUSHB["+a+"]");for(var f=0;f<a;f++)c.push(d[++e]);b.ip=e}function ib(a,b){var c=b.ip,d=b.prog,e=b.stack;lb&&console.log(b.ip,"PUSHW["+a+"]");for(var f=0;f<a;f++){var g=d[++c]<<8|d[++c];32768&g&&(g=-(1+(65535^g))),e.push(g)}b.ip=c}function jb(a,b,c,d,e,f){var g,h,i,j,k=f.stack,l=a&&k.pop(),m=k.pop(),n=f.rp0,o=f.z0[n],p=f.z1[m],q=f.minDis,r=f.fv,s=f.dpv;h=g=s.distance(p,o,!0,!0),i=h>=0?1:-1,h=Math.abs(h),a&&(j=f.cvt[l],d&&Math.abs(h-j)<f.cvCutIn&&(h=j)),c&&h<q&&(h=q),d&&(h=f.round(h)),r.setRelative(p,o,i*h,s),r.touch(p),lb&&console.log(f.step,(a?"MIRP[":"MDRP[")+(b?"M":"m")+(c?">":"_")+(d?"R":"_")+(0===e?"Gr":1===e?"Bl":2===e?"Wh":"")+"]",a?l+"("+f.cvt[l]+","+j+")":"",m,"(d =",g,"->",i*h,")"),f.rp1=f.rp0,f.rp2=m,b&&(f.rp0=m)}var kb,q,p,o,lb=!1,mb=function(a){var b=this.srPeriod,c=this.srPhase,d=this.srThreshold,e=1;return a<0&&(a=-a,e=-1),a+=d-c,a=Math.trunc(a/b)*b,a+=c,e>0&&a<0?c:e<0&&a>0?-c:a*e},nb={x:1,y:0,axis:"x",distance:function(a,b,c,d){return(c?a.xo:a.x)-(d?b.xo:b.x)},interpolate:function(a,b,c,d){var e,f,g,h,i,j,k;return d&&d!==this?(e=d.distance(a,b,!0,!0),f=d.distance(a,c,!0,!0),i=d.distance(b,b,!1,!0),j=d.distance(c,c,!1,!0),g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void nb.setRelative(a,a,(i+j)/2,d,!0):void nb.setRelative(a,a,(i*h+j*g)/k,d,!0)):(e=a.xo-b.xo,f=a.xo-c.xo,i=b.x-b.xo,j=c.x-c.xo,g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void(a.x=a.xo+(i+j)/2):void(a.x=a.xo+(i*h+j*g)/k))},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(a,b,c,d,e){if(!d||d===this)return void(a.x=(e?b.xo:b.x)+c);var f=e?b.xo:b.x,g=e?b.yo:b.y,h=f+c*d.x,i=g+c*d.y;a.x=h+(a.y-i)/d.normalSlope},slope:0,touch:function(a){a.xTouched=!0},touched:function(a){return a.xTouched},untouch:function(a){a.xTouched=!1}},ob={x:0,y:1,axis:"y",distance:function(a,b,c,d){return(c?a.yo:a.y)-(d?b.yo:b.y)},interpolate:function(a,b,c,d){var e,f,g,h,i,j,k;return d&&d!==this?(e=d.distance(a,b,!0,!0),f=d.distance(a,c,!0,!0),i=d.distance(b,b,!1,!0),j=d.distance(c,c,!1,!0),g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void ob.setRelative(a,a,(i+j)/2,d,!0):void ob.setRelative(a,a,(i*h+j*g)/k,d,!0)):(e=a.yo-b.yo,f=a.yo-c.yo,i=b.y-b.yo,j=c.y-c.yo,g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void(a.y=a.yo+(i+j)/2):void(a.y=a.yo+(i*h+j*g)/k))},normalSlope:0,setRelative:function(a,b,c,d,e){if(!d||d===this)return void(a.y=(e?b.yo:b.y)+c);var f=e?b.xo:b.x,g=e?b.yo:b.y,h=f+c*d.x,i=g+c*d.y;a.y=i+d.normalSlope*(a.x-h)},slope:Number.POSITIVE_INFINITY,touch:function(a){a.yTouched=!0},touched:function(a){return a.yTouched},untouch:function(a){a.yTouched=!1}};Object.freeze(nb),Object.freeze(ob),k.prototype.distance=function(a,b,c,d){return this.x*nb.distance(a,b,c,d)+this.y*ob.distance(a,b,c,d)},k.prototype.interpolate=function(a,b,c,d){var e,f,g,h,i,j,k;if(g=d.distance(a,b,!0,!0),h=d.distance(a,c,!0,!0),e=d.distance(b,b,!1,!0),f=d.distance(c,c,!1,!0),i=Math.abs(g),j=Math.abs(h),0===(k=i+j))return void this.setRelative(a,a,(e+f)/2,d,!0);this.setRelative(a,a,(e*j+f*i)/k,d,!0)},k.prototype.setRelative=function(a,b,c,d,e){d=d||this;var f=e?b.xo:b.x,g=e?b.yo:b.y,h=f+c*d.x,i=g+c*d.y,j=d.normalSlope,k=this.slope,l=a.x,m=a.y;a.x=(k*l-j*h+i-m)/(k-j),a.y=k*(a.x-l)+m},k.prototype.touch=function(a){a.°äŒf +for(var d=[],e=this.getLookupTables(b,c,a,3),f=0;f<e.length;f++)for(var g=e[f].subtables,h=0;h<g.length;h++)for(var i=g[h],j=this.expandCoverage(i.coverage),k=i.alternateSets,l=0;l<j.length;l++)d.push({sub:j[l],by:k[l]});return d},h.prototype.getLigatures=function(a,b,c){for(var d=[],e=this.getLookupTables(b,c,a,4),f=0;f<e.length;f++)for(var g=e[f].subtables,h=0;h<g.length;h++)for(var i=g[h],j=this.expandCoverage(i.coverage),k=i.ligatureSets,l=0;l<j.length;l++)for(var m=j[l],n=k[l],o=0;o<n.length;o++){var p=n[o];d.push({sub:[m].concat(p.components),by:p.ligGlyph})}return d},h.prototype.addSingle=function(a,b,c,d){var g=this.getLookupTables(c,d,a,1,!0)[0],h=e(g,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});f.assert(1===h.coverage.format,"Ligature: unable to modify coverage table format "+h.coverage.format);var i=b.sub,j=this.binSearch(h.coverage.glyphs,i);j<0&&(j=-1-j,h.coverage.glyphs.splice(j,0,i),h.substitute.splice(j,0,0)),h.substitute[j]=b.by},h.prototype.addAlternate=function(a,b,c,d){var g=this.getLookupTables(c,d,a,3,!0)[0],h=e(g,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});f.assert(1===h.coverage.format,"Ligature: unable to modify coverage table format "+h.coverage.format);var i=b.sub,j=this.binSearch(h.coverage.glyphs,i);j<0&&(j=-1-j,h.coverage.glyphs.splice(j,0,i),h.alternateSets.splice(j,0,0)),h.alternateSets[j]=b.by},h.prototype.addLigature=function(a,b,c,e){var g=this.getLookupTables(c,e,a,4,!0)[0],h=g.subtables[0];h||(h={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},g.subtables[0]=h),f.assert(1===h.coverage.format,"Ligature: unable to modify coverage table format "+h.coverage.format);var i=b.sub[0],j=b.sub.slice(1),k={ligGlyph:b.by,components:j},l=this.binSearch(h.coverage.glyphs,i);if(l>=0){for(var m=h.ligatureSets[l],n=0;n<m.length;n++)if(d(m[n].components,j))return;m.push(k)}else l=-1-l,h.coverage.glyphs.splice(l,0,i),h.ligatureSets.splice(l,0,[k])},h.prototype.getFeature=function(a,b,c){if(/ss\d\d/.test(a))return this.getSingle(a,b,c);switch(a){case"aalt":case"salt":return this.getSingle(a,b,c).concat(this.getAlternates(a,b,c));case"dlig":case"liga":case"rlig":return this.getLigatures(a,b,c)}},h.prototype.add=function(a,b,c,d){if(/ss\d\d/.test(a))return this.addSingle(a,b,c,d);switch(a){case"aalt":case"salt":return"number"==typeof b.by?this.addSingle(a,b,c,d):this.addAlternate(a,b,c,d);case"dlig":case"liga":case"rlig":return this.addLigature(a,b,c,d)}},b.exports=h},{"./check":10,"./layout":17}],22:[function(a,b,c){"use strict";function d(a,b,c){var d;for(d=0;d<b.length;d+=1){var e=b[d];this[e.name]=e.value}if(this.tableName=a,this.fields=b,c){var f=Object.keys(c);for(d=0;d<f.length;d+=1){var g=f[d],h=c[g];void 0!==this[g]&&(this[g]=h)}}}function e(a,b,c){void 0===c&&(c=b.length);var d=new Array(b.length+1);d[0]={name:a+"Count",type:"USHORT",value:c};for(var e=0;e<b.length;e++)d[e+1]={name:a+e,type:"USHORT",value:b[e]};return d}function f(a,b,c){var d=b.length,e=new Array(d+1);e[0]={name:a+"Count",type:"USHORT",value:d};for(var f=0;f<d;f++)e[f+1]={name:a+f,type:"TABLE",value:c(b[f],f)};return e}function g(a,b,c){var d=b.length,e=[];e[0]={name:a+"Count",type:"USHORT",value:d};for(var f=0;f<d;f++)e=e.concat(c(b[f],f));return e}function h(a){1===a.format?d.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(e("glyph",a.glyphs))):l.assert(!1,"Can't create coverage table format 2 yet.")}function i(a){d.call(this,"scriptListTable",g("scriptRecord",a,function(a,b){var c=a.script,f=c.defaultLangSys;return l.assert(!!f,"Unable to write GSUB: script "+a.tag+" has no default language system."),[{name:"scriptTag"+b,type:"TAG",value:a.tag},{name:"script"+b,type:"TABLE",value:new d("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new d("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:f.reqFeatureIndex}].concat(e("featureIndex",f.featureIndexes)))}].concat(g("langSys",c.langSysRecords,function(a,b){var c=a.langSys;return[{name:"langSysTag"+b,type:"TAG",value:a.tag},{name:"langSys"+b,type:"TABLE",value:new d("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:c.reqFeatureIndex}].concat(e("featureIndex",c.featureIndexes)))}]})))}]}))}function j(a){d.call(this,"featureListTable",g("featureRecord",a,function(a,b){var c=a.feature;return[{name:"featureTag"+b,type:"TAG",value:a.tag},{name:"feature"+b,type:"TABLE",value:new d("featureTable",[{name:"featureParams",type:"USHORT",value:c.featureParams}].concat(e("lookupListIndex",c.lookupListIndexes)))}]}))}function k(a,b){d.call(this,"lookupListTable",f("lookup",a,function(a){var c=b[a.lookupType];return l.assert(!!c,"Unable to write GSUB lookup type "+a.lookupType+" tables."),new d("lookupTable",[{name:"lookupType",type:"USHORT",value:a.lookupType},{name:"lookupFlag",type:"USHORT",value:a.lookupFlag}].concat(f("subtable",a.subtables,c)))}))}var l=a("./check"),m=a("./types").encode,n=a("./types").sizeOf;d.prototype.encode=function(){return m.TABLE(this)},d.prototype.sizeOf=function(){return n.TABLE(this)},h.prototype=Object.create(d.prototype),h.prototype.constructor=h,i.prototype=Object.create(d.prototype),i.prototype.constructor=i,j.prototype=Object.create(d.prototype),j.prototype.constructor=j,k.prototype=Object.create(d.prototype),k.prototype.constructor=k,c.Record=c.Table=d,c.Coverage=h,c.ScriptList=i,c.FeatureList=j,c.LookupList=k,c.ushortList=e,c.tableList=f,c.recordList=g},{"./check":10,"./types":41}],23:[function(a,b,c){"use strict";function d(a,b){if(a===b)return!0;if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return!1;for(var c=0;c<a.length;c+=1)if(!d(a[c],b[c]))return!1;return!0}return!1}function e(a){return a.length<1240?107:a.length<33900?1131:32768}function f(a,b,c){var d,e,f,g=[],h=[],i=K.getCard16(a,b);if(0!==i){var j=K.getByte(a,b+2);e=b+(i+1)*j+2;var k=b+3;for(d=0;d<i+1;d+=1)g.push(K.getOffset(a,k,j)),k+=j;f=e+g[i]}else f=b+2;for(d=0;d<g.length-1;d+=1){var l=K.getBytes(a,e+g[d],e+g[d+1]);c&&(l=c(l)),h.push(l)}return{objects:h,startOffset:b,endOffset:f}}function g(a){for(var b="",c=15,d=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var e=a.parseByte(),f=e>>4,g=15&e;if(f===c)break;if(b+=d[f],g===c)break;b+=d[g]}return parseFloat(b)}function h(a,b){var c,d,e,f;if(28===b)return c=a.parseByte(),d=a.parseByte(),c<<8|d;if(29===b)return c=a.parseByte(),d=a.parseByte(),e=a.parseByte(),f=a.parseByte(),c<<24|d<<16|e<<8|f;if(30===b)return g(a);if(b>=32&&b<=246)return b-139;if(b>=247&&b<=250)return c=a.parseByte(),256*(b-247)+c+108;if(b>=251&&b<=254)return c=a.parseByte(),256*-(b-251)-c-108;throw new Error("Invalid b0 "+b)}function i(a){for(var b={},c=0;c<a.length;c+=1){var d,e=a[c][0],f=a[c][1];if(d=1===f.length?f[0]:f,b.hasOwnProperty(e))throw new Error("Object "+b+" already has key "+e);b[e]=d}return b}function j(a,b,c){b=void 0!==b?b:0;var d=new K.Parser(a,b),e=[],f=[];for(c=void 0!==c?c:a.length;d.relativeOffset<c;){var g=d.parseByte();g<=21?(12===g&&(g=1200+d.parseByte()),e.push([g,f]),f=[]):f.push(h(d,g))}return i(e)}function k(a,b){return b=b<=390?I.cffStandardStrings[b]:a[b-391]}function l(a,b,c){for(var d,e={},f=0;f<b.length;f+=1){var g=b[f];if(Array.isArray(g.type)){var h=[];h.length=g.type.length;for(var i=0;i<g.type.length;i++)d=void 0!==a[g.op]?a[g.op][i]:void 0,void 0===d&&(d=void 0!==g.value&&void 0!==g.value[i]?g.value[i]:null),"SID"===g.type[i]&&(d=k(c,d)),h[i]=d;e[g.name]=h}else d=a[g.op],void 0===d&&(d=void 0!==g.value?g.value:null),"SID"===g.type&&(d=k(c,d)),e[g.name]=d}return e}function m(a,b){var c={};return c.formatMajor=K.getCard8(a,b),c.formatMinor=K.getCard8(a,b+1),c.size=K.getCard8(a,b+2),c.offsetSize=K.getCard8(a,b+3),c.startOffset=b,c.endOffset=b+4,c}function n(a,b){return l(j(a,0,a.byteLength),N,b)}function o(a,b,c,d){return l(j(a,b,c),O,d)}function p(a,b,c,d){for(var g=[],h=0;h<c.length;h+=1){var i=new DataView(new Uint8Array(c[h]).buffer),j=n(i,d);j._subrs=[],j._subrsBias=0;var k=j.private[0],l=j.private[1];if(0!==k&&0!==l){var m=o(a,l+b,k,d);if(j._defaultWidthX=m.defaultWidthX,j._nominalWidthX=m.nominalWidthX,0!==m.subrs){var p=l+m.subrs,q=f(a,p+b);j._subrs=q.objects,j._subrsBias=e(j._subrs)}j._privateDict=m}g.push(j)}return g}function q(a,b,c,d){var e,f,g,h=new K.Parser(a,b);c-=1;var i=[".notdef"],j=h.parseCard8();if(0===j)for(e=0;e<c;e+=1)f=h.parseSID(),i.push(k(d,f));else if(1===j)for(;i.length<=c;)for(f=h.parseSID(),g=h.parseCard8(),e=0;e<=g;e+=1)i.push(k(d,f)),f+=1;else{if(2!==j)throw new Error("Unknown charset format "+j);for(;i.length<=c;)for(f=h.parseSID(),g=h.parseCard16(),e=0;e<=g;e+=1)i.push(k(d,f)),f+=1}return i}function r(a,b,c){var d,e,f={},g=new K.Parser(a,b),h=g.parseCard8();if(0===h){var i=g.parseCard8();for(d=0;d<i;d+=1)e=g.parseCard8(),f[e]=d}else{if(1!==h)throw new Error("Unknown encoding format "+h);var j=g.parseCard8();for(e=1,d=0;d<j;d+=1)for(var k=g.parseCard8(),l=g.parseCard8(),m=k;m<=k+l;m+=1)f[m]=e,e+=1}return new I.CffEncoding(f,c)}function s(a,b,c){function d(a,b){s&&o.closePath(),o.moveTo(a,b),s=!0}function e(){var a;a=p.length%2!=0,a&&!r&&(x=p.shift()+n),q+=p.length>>1,p.length=0,r=!0}function f(c){for(var m,v,w,y,z,A,B,C,D,E,F,G,H=0;H<c.length;){var I=c[H];switch(H+=1,I){case 1:e();break;case 3:e();break;case 4:p.length>1&&!r&&(x=p.shift()+n,r=!0),u+=p.pop(),d(t,u);break;case 5:for(;p.length>0;)t+=p.shift(),u+=p.shift(),o.lineTo(t,u);break;case 6:for(;p.length>0&&(t+=p.shift(),o.lineTo(t,u),0!==p.length);)u+=p.shift(),o.lineTo(t,u);break;case 7:for(;p.length>0&&(u+=p.shift(),o.lineTo(t,u),0!==p.length);)t+=p.shift(),o.lineTo(t,u);break;case 8:for(;p.length>0;)g=t+p.shift(),h=u+p.shift(),i=g+p.shift(),j=h+p.shift(),t=i+p.shift(),u=j+p.shift(),o.curveTo(g,h,i,j,t,u);break;case 10:z=p.pop()+l,A=k[z],A&&f(A);break;case 11:return;case 12:switch(I=c[H],H+=1,I){case 35:g=t+p.shift(),h=u+p.shift(),i=g+p.shift(),j=h+p.shift(),B=i+p.shift(),C=j+p.shift(),D=B+p.shift(),E=C+p.shift(),F=D+p.shift(),G=E+p.shift(),t=F+p.shift(),u=G+p.shift(),p.shift(),o.curveTo(g,h,i,j,B,C),o.curveTo(D,E,F,G,t,u);break;case 34:g=t+p.shift(),h=u,i=g+p.shift(),j=h+p.shift(),B=i+p.shift(),C=j,D=B+p.shift(),E=j,F=D+p.shift(),G=u,t=F+p.shift(),o.curveTo(g,h,i,j,B,C),o.curveTo(D,E,F,G,t,u);break;case 36:g=t+p.shift(),h=u+p.shift(),i=g+p.shift(),j=h+p.shift(),B=i+p.shift(),C=j,D=B+p.shift(),E=j,F=D+p.shift(),G=E+p.shift(),t=F+p.shift(),o.curveTo(g,h,i,j,B,C),o.curveTo(D,E,F,G,t,u);break;case 37:g=t+p.shift(),h=u+p.shift(),i=g+p.shift(),j=h+p.shift(),B=i+p.shift(),C=j+p.shift(),D=B+p.shift(),E=C+p.shift(),F=D+p.shift(),G=E+p.shift(),Math.abs(F-t)>Math.abs(G-u)?t=F+p°äŒf +;for(C=0;C<i.length;C++)F[i[C]]=1;return function(a,b){if(F[a]){var c=z(a),d=A(b),e=B[c];return e?e[d]:void 0}}}}}function h(a,b){var c=new k.Parser(a,b),d=c.parseUShort(),e=c.parseUShort(),f=16&e,h=c.parseUShort(),i=c.parseOffset16List(h),j={lookupType:d,lookupFlag:e,markFilteringSet:f?c.parseUShort():-1};if(2===d){for(var l=[],m=0;m<h;m++){var n=g(a,b+i[m]);n&&l.push(n)}j.getKerningValue=function(a,b){for(var c=l.length;c--;){var d=l[c](a,b);if(void 0!==d)return d}return 0}}return j}function i(a,b,c){var e=new k.Parser(a,b),f=e.parseFixed();j.argument(1===f,"Unsupported GPOS table version."),d(a,b+e.parseUShort()),d(a,b+e.parseUShort());var g=e.parseUShort();e.relativeOffset=g;for(var i=e.parseUShort(),l=e.parseOffset16List(i),m=b+g,n=0;n<i;n++){var o=h(a,m+l[n]);2!==o.lookupType||c.getGposKerningValue||(c.getGposKerningValue=o.getKerningValue)}}var j=a("../check"),k=a("../parse");c.parse=i},{"../check":10,"../parse":19}],28:[function(a,b,c){"use strict";function d(a,b){b=b||0;var c=new g(a,b),d=c.parseVersion();return f.argument(1===d,"Unsupported GSUB table version."),{version:d,scripts:c.parseScriptList(),features:c.parseFeatureList(),lookups:c.parseLookupList(h)}}function e(a){return new i.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new i.ScriptList(a.scripts)},{name:"features",type:"TABLE",value:new i.FeatureList(a.features)},{name:"lookups",type:"TABLE",value:new i.LookupList(a.lookups,k)}])}var f=a("../check"),g=a("../parse").Parser,h=new Array(9),i=a("../table");h[1]=function(){var a=this.offset+this.relativeOffset,b=this.parseUShort();return 1===b?{substFormat:1,coverage:this.parsePointer(g.coverage),deltaGlyphId:this.parseUShort()}:2===b?{substFormat:2,coverage:this.parsePointer(g.coverage),substitute:this.parseOffset16List()}:void f.assert(!1,"0x"+a.toString(16)+": lookup type 1 format must be 1 or 2.")},h[2]=function(){var a=this.parseUShort();return f.argument(1===a,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:a,coverage:this.parsePointer(g.coverage),sequences:this.parseListOfLists()}},h[3]=function(){var a=this.parseUShort();return f.argument(1===a,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:a,coverage:this.parsePointer(g.coverage),alternateSets:this.parseListOfLists()}},h[4]=function(){var a=this.parseUShort();return f.argument(1===a,"GSUB ligature table identifier-format must be 1"),{substFormat:a,coverage:this.parsePointer(g.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var j={sequenceIndex:g.uShort,lookupListIndex:g.uShort};h[5]=function(){var a=this.offset+this.relativeOffset,b=this.parseUShort();if(1===b)return{substFormat:b,coverage:this.parsePointer(g.coverage),ruleSets:this.parseListOfLists(function(){var a=this.parseUShort(),b=this.parseUShort();return{input:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(b,j)}})};if(2===b)return{substFormat:b,coverage:this.parsePointer(g.coverage),classDef:this.parsePointer(g.classDef),classSets:this.parseListOfLists(function(){var a=this.parseUShort(),b=this.parseUShort();return{classes:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(b,j)}})};if(3===b){var c=this.parseUShort(),d=this.parseUShort();return{substFormat:b,coverages:this.parseList(c,g.pointer(g.coverage)),lookupRecords:this.parseRecordList(d,j)}}f.assert(!1,"0x"+a.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},h[6]=function(){var a=this.offset+this.relativeOffset,b=this.parseUShort();return 1===b?{substFormat:1,coverage:this.parsePointer(g.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(j)}})}:2===b?{substFormat:2,coverage:this.parsePointer(g.coverage),backtrackClassDef:this.parsePointer(g.classDef),inputClassDef:this.parsePointer(g.classDef),lookaheadClassDef:this.parsePointer(g.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(j)}})}:3===b?{substFormat:3,backtrackCoverage:this.parseList(g.pointer(g.coverage)),inputCoverage:this.parseList(g.pointer(g.coverage)),lookaheadCoverage:this.parseList(g.pointer(g.coverage)),lookupRecords:this.parseRecordList(j)}:void f.assert(!1,"0x"+a.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},h[7]=function(){var a=this.parseUShort();f.argument(1===a,"GSUB Extension Substitution subtable identifier-format must be 1");var b=this.parseUShort(),c=new g(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:b,extension:h[b].call(c)}},h[8]=function(){var a=this.parseUShort();return f.argument(1===a,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:a,coverage:this.parsePointer(g.coverage),backtrackCoverage:this.parseList(g.pointer(g.coverage)),lookaheadCoverage:this.parseList(g.pointer(g.coverage)),substitutes:this.parseUShortList()}};var k=new Array(9);k[1]=function(a){return 1===a.substFormat?new i.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new i.Coverage(a.coverage)},{name:"deltaGlyphID",type:"USHORT",value:a.deltaGlyphId}]):new i.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new i.Coverage(a.coverage)}].concat(i.ushortList("substitute",a.substitute)))},k[3]=function(a){return f.assert(1===a.substFormat,"Lookup type 3 substFormat must be 1."),new i.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new i.Coverage(a.coverage)}].concat(i.tableList("altSet",a.alternateSets,function(a){return new i.Table("alternateSetTable",i.ushortList("alternate",a))})))},k[4]=function(a){return f.assert(1===a.substFormat,"Lookup type 4 substFormat must be 1."),new i.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new i.Coverage(a.coverage)}].concat(i.tableList("ligSet",a.ligatureSets,function(a){return new i.Table("ligatureSetTable",i.tableList("ligature",a,function(a){return new i.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:a.ligGlyph}].concat(i.ushortList("component",a.components,a.components.length+1)))}))})))},c.parse=d,c.make=e},{"../check":10,"../parse":19,"../table":22}],29:[function(a,b,c){"use strict";function d(a,b){var c={},d=new g.Parser(a,b);return c.version=d.parseVersion(),c.fontRevision=Math.round(1e3*d.parseFixed())/1e3,c.checkSumAdjustment=d.parseULong(),c.magicNumber=d.parseULong(),f.argument(1594834165===c.magicNumber,"Font header has wrong magic number."),c.flags=d.parseUShort(),c.unitsPerEm=d.parseUShort(),c.created=d.parseLongDateTime(),c.modified=d.parseLongDateTime(),c.xMin=d.parseShort(),c.yMin=d.parseShort(),c.xMax=d.parseShort(),c.yMax=d.parseShort(),c.macStyle=d.parseUShort(),c.lowestRecPPEM=d.parseUShort(),c.fontDirectionHint=d.parseShort(),c.indexToLocFormat=d.parseShort(),c.glyphDataFormat=d.parseShort(),c}function e(a){var b=Math.round((new Date).getTime()/1e3)+2082844800,c=b;return a.createdTimestamp&&(c=a.createdTimestamp+2082844800),new h.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:c},{name:"modified",type:"LONGDATETIME",value:b},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],a)}var f=a("../check"),g=a("../parse"),h=a("../table");c.parse=d,c.make=e},{"../check":10,"../parse":19,"../table":22}],30:[function(a,b,c){"use strict";function d(a,b){var c={},d=new f.Parser(a,b);return c.version=d.parseVersion(),c.ascender=d.parseShort(),c.descender=d.parseShort(),c.lineGap=d.parseShort(),c.advanceWidthMax=d.parseUShort(),c.minLeftSideBearing=d.parseShort(),c.minRightSideBearing=d.parseShort(),c.xMaxExtent=d.parseShort(),c.caretSlopeRise=d.parseShort(),c.caretSlopeRun=d.parseShort(),c.caretOffset=d.parseShort(),d.relativeOffset+=8,c.metricDataFormat=d.parseShort(),c.numberOfHMetrics=d.parseUShort(),c}function e(a){return new g.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],a)}var f=a("../parse"),g=a("../table");c.parse=d,c.make=e},{"../parse":19,"../table":22}],31:[function(a,b,c){"use strict";function d(a,b,c,d,e){for(var g,h,i=new f.Parser(a,b),j=0;j<d;j+=1){j<c&&(g=i.parseUShort(),h=i.parseShort());var k=e.get(j);k.advanceWidth=g,k.leftSideBearing=h}}function e(a){for(var b=new g.Table("hmtx",[]),c=0;c<a.length;c+=1){var d=a.get(c),e=d.advanceWidth||0,f=d.leftSideBearing||0;b.fields.push({name:"advanceWidth_"+c,type:"USHORT",value:e}),b.fields.push({name:"leftSideBearing_"+c,type:"SHORT",value:f})}return b}var f=a("../parse"),g=a("../table");c.parse=d,c.make=e},{"../parse":19,"../table":22}],32:[function(a,b,c){"use strict";function d(a){var b={};a.skip("uShort");var c=a.parseUShort();g.argument(0===c,"Unsupported kern sub-table version."),a.skip("uShort",2);var d=a.parseUShort();a.skip("uShort",3);for(var e=0;e<d;e+=1){var f=a.parseUShort(),h=a.parseUShort(),i=a.parseShort();b[f+","+h]=i}return b}function e(a){var b={};a.skip("uShort"),a.parseULong()>1&&console.warn("Only the first kern subtable is supported."),a.skip("uLong");var c=a.parseUShort(),d=255&c;if(a.skip("uShort"),0===d){var e=a.parseUShort();a.skip("uShort",3);for(var f=0;f<e;f+=1){var g=a.parseUShort(),h=a.parseUShort(),i=a.parseShort();b[g+","+h]=i}}return b}function f(a,b){var c=new h.Parser(a,b),f=c.parseUShort();if(0===f)return d(c);if(1===f)return e(c);throw new Error("Unsupported kern table version ("+f+").")}var g=a("../check"),h=a("../parse");c.parse=f},{"../check":10,"../parse":19}],33:[function(a,b,c){"use strict";function d(a,b,c,d){for(var f=new e.Parser(a,b),g=d?f.parseUShort:f.parseULong,h=[],i=0;i<c+1;i+=1){var j=g.call(f);d&&(j*=2),h.push(j)}return h}var e=a("../parse");c.parse=d},{"../parse":19}],34:[function(a,b,c){"use strict";function d(a){for(var b=new h.Table("ltag",[{name:"version",type:"°äŒf +}var J={xMin:Math.min.apply(null,c),yMin:Math.min.apply(null,d),xMax:Math.max.apply(null,f),yMax:Math.max.apply(null,j),advanceWidthMax:Math.max.apply(null,k),advanceWidthAvg:i(k),minLeftSideBearing:Math.min.apply(null,l),maxLeftSideBearing:Math.max.apply(null,l),minRightSideBearing:Math.min.apply(null,y)};J.ascender=a.ascender,J.descender=a.descender;var K=o.make({flags:3,unitsPerEm:a.unitsPerEm,xMin:J.xMin,yMin:J.yMin,xMax:J.xMax,yMax:J.yMax,lowestRecPPEM:3,createdTimestamp:a.createdTimestamp}),L=p.make({ascender:J.ascender,descender:J.descender,advanceWidthMax:J.advanceWidthMax,minLeftSideBearing:J.minLeftSideBearing,minRightSideBearing:J.minRightSideBearing,xMaxExtent:J.maxLeftSideBearing+(J.xMax-J.xMin),numberOfHMetrics:a.glyphs.length}),M=s.make(a.glyphs.length),N=u.make({xAvgCharWidth:Math.round(J.advanceWidthAvg),usWeightClass:a.tables.os2.usWeightClass,usWidthClass:a.tables.os2.usWidthClass,usFirstCharIndex:b,usLastCharIndex:z,ulUnicodeRange1:A,ulUnicodeRange2:B,ulUnicodeRange3:C,ulUnicodeRange4:D,fsSelection:a.tables.os2.fsSelection,sTypoAscender:J.ascender,sTypoDescender:J.descender,sTypoLineGap:0,usWinAscent:J.yMax,usWinDescent:Math.abs(J.yMin),ulCodePageRange1:1,sxHeight:h(a,"xyvw",{yMax:Math.round(J.ascender/2)}).yMax,sCapHeight:h(a,"HIKLEFJMNTZBDPRAGOQSUVWXY",J).yMax,usDefaultChar:a.hasChar(" ")?32:0,usBreakChar:a.hasChar(" ")?32:0}),O=q.make(a.glyphs),P=m.make(a.glyphs),Q=a.getEnglishName("fontFamily"),R=a.getEnglishName("fontSubfamily"),S=Q+" "+R,T=a.getEnglishName("postScriptName");T||(T=Q.replace(/\s/g,"")+"-"+R);var U={};for(var V in a.names)U[V]=a.names[V];U.uniqueID||(U.uniqueID={en:a.getEnglishName("manufacturer")+":"+S}),U.postScriptName||(U.postScriptName={en:T}),U.preferredFamily||(U.preferredFamily=a.names.fontFamily),U.preferredSubfamily||(U.preferredSubfamily=a.names.fontSubfamily);var W=[],X=t.make(U,W),Y=W.length>0?r.make(W):void 0,Z=v.make(),$=n.make(a.glyphs,{version:a.getEnglishName("version"),fullName:S,familyName:Q,weightName:R,postScriptName:T,unitsPerEm:a.unitsPerEm,fontBBox:[0,J.yMin,J.ascender,J.advanceWidthMax]}),_=a.metas&&Object.keys(a.metas).length>0?x.make(a.metas):void 0,aa=[K,L,M,N,X,P,Z,$,O];Y&&aa.push(Y),a.tables.gsub&&aa.push(w.make(a.tables.gsub)),_&&aa.push(_);var ba=g(aa),ca=ba.encode(),da=e(ca),ea=ba.fields,fa=!1;for(E=0;E<ea.length;E+=1)if("head table"===ea[E].name){ea[E].value.checkSumAdjustment=2981146554-da,fa=!0;break}if(!fa)throw new Error("Could not find head table with checkSum to adjust.");return ba}var k=a("../check"),l=a("../table"),m=a("./cmap"),n=a("./cff"),o=a("./head"),p=a("./hhea"),q=a("./hmtx"),r=a("./ltag"),s=a("./maxp"),t=a("./name"),u=a("./os2"),v=a("./post"),w=a("./gsub"),x=a("./meta");c.computeCheckSum=e,c.make=g,c.fontToTable=j},{"../check":10,"../table":22,"./cff":23,"./cmap":24,"./gsub":28,"./head":29,"./hhea":30,"./hmtx":31,"./ltag":34,"./maxp":35,"./meta":36,"./name":37,"./os2":38,"./post":39}],41:[function(a,b,c){"use strict";function d(a){return function(){return a}}function e(a){return a>=-128&&a<=127}function f(a,b,c){for(var d=0,e=a.length;b<e&&d<64&&0===a[b];)++b,++d;return c.push(128|d-1),b}function g(a,b,c){for(var d=0,f=a.length,g=b;g<f&&d<64;){var h=a[g];if(!e(h))break;if(0===h&&g+1<f&&0===a[g+1])break;++g,++d}c.push(d-1);for(var i=b;i<g;++i)c.push(a[i]+256&255);return g}function h(a,b,c){for(var d=0,f=a.length,g=b;g<f&&d<64;){var h=a[g];if(0===h)break;if(e(h)&&g+1<f&&e(a[g+1]))break;++g,++d}c.push(64|d-1);for(var i=b;i<g;++i){var j=a[i];c.push(j+65536>>8&255,j+256&255)}return g}var i=a("./check"),j=32768,k=2147483648,l={},m={},n={};m.BYTE=function(a){return i.argument(a>=0&&a<=255,"Byte value should be between 0 and 255."),[a]},n.BYTE=d(1),m.CHAR=function(a){return[a.charCodeAt(0)]},n.CHAR=d(1),m.CHARARRAY=function(a){for(var b=[],c=0;c<a.length;c+=1)b[c]=a.charCodeAt(c);return b},n.CHARARRAY=function(a){return a.length},m.USHORT=function(a){return[a>>8&255,255&a]},n.USHORT=d(2),m.SHORT=function(a){return a>=j&&(a=-(2*j-a)),[a>>8&255,255&a]},n.SHORT=d(2),m.UINT24=function(a){return[a>>16&255,a>>8&255,255&a]},n.UINT24=d(3),m.ULONG=function(a){return[a>>24&255,a>>16&255,a>>8&255,255&a]},n.ULONG=d(4),m.LONG=function(a){return a>=k&&(a=-(2*k-a)),[a>>24&255,a>>16&255,a>>8&255,255&a]},n.LONG=d(4),m.FIXED=m.ULONG,n.FIXED=n.ULONG,m.FWORD=m.SHORT,n.FWORD=n.SHORT,m.UFWORD=m.USHORT,n.UFWORD=n.USHORT,m.LONGDATETIME=function(a){return[0,0,0,0,a>>24&255,a>>16&255,a>>8&255,255&a]},n.LONGDATETIME=d(8),m.TAG=function(a){return i.argument(4===a.length,"Tag should be exactly 4 ASCII characters."),[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)]},n.TAG=d(4),m.Card8=m.BYTE,n.Card8=n.BYTE,m.Card16=m.USHORT,n.Card16=n.USHORT,m.OffSize=m.BYTE,n.OffSize=n.BYTE,m.SID=m.USHORT,n.SID=n.USHORT,m.NUMBER=function(a){return a>=-107&&a<=107?[a+139]:a>=108&&a<=1131?(a-=108,[247+(a>>8),255&a]):a>=-1131&&a<=-108?(a=-a-108,[251+(a>>8),255&a]):a>=-32768&&a<=32767?m.NUMBER16(a):m.NUMBER32(a)},n.NUMBER=function(a){return m.NUMBER(a).length},m.NUMBER16=function(a){return[28,a>>8&255,255&a]},n.NUMBER16=d(3),m.NUMBER32=function(a){return[29,a>>24&255,a>>16&255,a>>8&255,255&a]},n.NUMBER32=d(5),m.REAL=function(a){var b=a.toString(),c=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(b);if(c){var d=parseFloat("1e"+((c[2]?+c[2]:0)+c[1].length));b=(Math.round(a*d)/d).toString()}var e,f,g="";for(e=0,f=b.length;e<f;e+=1){var h=b[e];g+="e"===h?"-"===b[++e]?"c":"b":"."===h?"a":"-"===h?"e":h}g+=1&g.length?"f":"ff";var i=[30];for(e=0,f=g.length;e<f;e+=2)i.push(parseInt(g.substr(e,2),16));return i},n.REAL=function(a){return m.REAL(a).length},m.NAME=m.CHARARRAY,n.NAME=n.CHARARRAY,m.STRING=m.CHARARRAY,n.STRING=n.CHARARRAY,l.UTF8=function(a,b,c){for(var d=[],e=c,f=0;f<e;f++,b+=1)d[f]=a.getUint8(b);return String.fromCharCode.apply(null,d)},l.UTF16=function(a,b,c){for(var d=[],e=c/2,f=0;f<e;f++,b+=2)d[f]=a.getUint16(b);return String.fromCharCode.apply(null,d)},m.UTF16=function(a){for(var b=[],c=0;c<a.length;c+=1){var d=a.charCodeAt(c);b[b.length]=d>>8&255,b[b.length]=255&d}return b},n.UTF16=function(a){return 2*a.length};var o={"x-mac-croatian":"ÄÅÇÉÑÖÜáà âäãåçéèêëÃìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑âˆÅ¡âˆ«ÂªÂºÎ©Å¾Ã¸Â¿Â¡Â¬âˆšÆ’≈ƫȅ ÀÃÕŒœÄ—“â€â€˜â€™Ã·â—Šï£¿Â©â„€‹›Æ»–·‚„‰ÂćÃÄÈÃÃŽÃÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"ÐБВГДЕЖЗИЙКЛМÐОПРСТУФХЦЧШЩЪЫЬÐЮЯ†°Ò£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“â€â€˜â€™Ã·â€žÐŽÑžÐÑŸâ„–ÐÑ‘ÑабвгдежзийклмнопрÑтуфхцчшщъыьÑÑŽ","x-mac-gaelic":"ÄÅÇÉÑÖÜáà âäãåçéèêëÃÃ¬Ã®Ã¯Ã±Ã³Ã²Ã´Ã¶ÃµÃºÃ¹Ã»Ã¼â€ Â°Â¢Â£Â§â€¢Â¶ÃŸÂ®Â©â„¢Â´Â¨â‰ Ã†Ã˜á¸‚Â±â‰¤â‰¥á¸ƒÄŠÄ‹á¸Šá¸‹á¸žá¸ŸÄ Ä¡á¹€Ã¦Ã¸á¹á¹–ṗɼƒſṠ«»… ÀÃÕŒœ–—“â€â€˜â€™á¹¡áº›Ã¿Å¸á¹ªâ‚¬â€¹â€ºÅ¶Å·á¹«Â·á»²á»³âŠÃ‚ÊÃËÈÃÃŽÃÌÓÔ♣ÒÚÛÙıÃýŴŵẄẅẀáºáº‚ẃ","x-mac-greek":"Ĺ²É³ÖÜ΅à âä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάάΟΡ≈Τ«»… ΥΧΆΈœ–―“â€â€˜â€™Ã·Î‰ÎŠÎŒÎŽÎήίόÎÏαβψδεφγηιξκλμνοπώÏστθωςχυζϊϋÎΰÂ","x-mac-icelandic":"ÄÅÇÉÑÖÜáà âäãåçéèêëÃìîïñóòôöõúùûü𢣧•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑âˆÏ€âˆ«ÂªÂºÎ©Ã¦Ã¸Â¿Â¡Â¬âˆšÆ’≈∆«»… ÀÃÕŒœ–—“â€â€˜â€™Ã·â—ŠÃ¿Å¸â„€ÃðÞþý·‚„‰ÂÊÃËÈÃÃŽÃÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸Ë˛ˇ","x-mac-inuit":"áƒá„á…á†áŠá‹á±á²á³á´á¸á¹á‘‰á‘Žá‘á‘ᑑᑕᑖᑦá‘ᑮᑯᑰᑲᑳᒃᒋᒌá’á’Žá’ᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈá“ᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫá”… ᔮᔾᕕᕖᕗ–—“â€â€˜â€™á•˜á•™á•šá•ᕆᕇᕈᕉᕋᕌá•á•¿á–€á–ᖂᖃᖄᖅá–á–ᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼÅÅ‚","x-mac-ce":"ÄĀÄÉĄÖÜáąČäÄĆć鏟ĎÃÄĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňÅÕőŌ–—“â€â€˜â€™Ã·â—ŠÅŔŕŘ‹›řŖŗŠ‚„šŚśÃŤťÃŽžŪÓÔūŮÚůŰűŲųÃýķŻÅżĢˇ",macintosh:"ÄÅÇÉÑÖÜáà âäãåçéèêëÃìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑âˆÏ€âˆ«ÂªÂºÎ©Ã¦Ã¸Â¿Â¡Â¬âˆšÆ’≈∆«»… ÀÃÕŒœ–—“â€â€˜â€™Ã·â—ŠÃ¿Å¸â„€‹›ï¬ï¬‚‡·‚„‰ÂÊÃËÈÃÃŽÃÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸Ë˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáà âäãåçéèêëÃìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑âˆÏ€âˆ«ÂªÂºÎ©ÄƒÈ™Â¿Â¡Â¬âˆšÆ’≈∆«»… ÀÃÕŒœ–—“â€â€˜â€™Ã·â—ŠÃ¿Å¸â„€‹›Țț‡·‚„‰ÂÊÃËÈÃÃŽÃÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸Ë˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáà âäãåçéèêëÃìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑âˆÏ€âˆ«ÂªÂºÎ©Ã¦Ã¸Â¿Â¡Â¬âˆšÆ’≈∆«»… ÀÃÕŒœ–—“â€â€˜â€™Ã·â—ŠÃ¿Å¸ÄžÄŸÄ°Ä±ÅžÅŸâ€¡Â·â€šâ€žâ€°Ã‚ÊÃËÈÃÃŽÃÃŒÃ“Ã”ï£¿Ã’ÃšÃ›Ã™ï¢ Ë†ËœÂ¯Ë˜Ë™ËšÂ¸Ë˛ˇ"};l.MACSTRING=function(a,b,c,d){var e=o[d];if(void 0!==e){for(var f="",g=0;g<c;g++){var h=a.getUint8(b+g);f+=h<=127?String.fromCharCode(h):e[127&h]}return f}};var p,q="function"==typeof WeakMap&&new WeakMap,r=function(a){if(!p){p={};for(var b in o)p[b]=new String(b)}var c=p[a];if(void 0!==c){if(q){var d=q.get(c);if(void 0!==d)return d}var e=o[a];if(void 0!==e){for(var f={},g=0;g<e.length;g++)f[e.charCodeAt(g)]=g+128;return q&&q.set(c,f),f}}};m.MACSTRING=function(a,b){var c=r(b);if(void 0!==c){for(var d=[],e=0;e<a.length;e++){var f=a.charCodeAt(e);if(f>=128&&void 0===(f=c[f]))return;d[e]=f}return d}},n.MACSTRING=function(a,b){var c=m.MACSTRING(a,b);return void 0!==c?c.length:0},m.VARDELTAS=function(a){for(var b=0,c=[];b<a.length;){var d=a[b];b=0===d?f(a,b,c):d>=-128&&d<=127?g(a,b,c):h(a,b,c)}return c},m.INDEX=function(a){var b,c=1,d=[c],e=[];for(b=0;b<a.length;b+=1){var f=m.OBJECT(a[b]);Array.prototype.push.apply(e,f),c+=f.length,d.push(c)}if(0===e.length)return[0,0];var g=[],h=1+Math.floor(Math.log(c)/Math.log(2))/8|0,i=[void 0,m.BYTE,m.USHORT,m.UINT24,m.ULONG][h];for(b=0;b<d.length;b+=1){var j=i(d[b]);Array.prototype.push.apply(g,j)}return Array.prototype.concat(m.Card16(a.length),m.OffSize(h),g,e)},n.INDEX=function(a){return m.INDEX(a).length},m.DICT=function(a){for(var b=[],c=Object.keys(a),d=c.length,e=0;e<d;e+=1){var f=parseInt(c[e],0),g=a[f];b=b.concat(m.OPERAND(g.value,g.type)),b=b.concat(m.OPERATOR(f))}return b},n.DICT=function(a){return m.DICT(a).length},m.OPERATOR=function(a){return a<1200?[a]:[12,a-1200]},m.OPERAND=function(a,b){var c=[];if(Array.isArray(b))for(var d=0;d<b.length;d+=1)i.argument(a.length===b.length,"Not enough arguments given for type"+b),c=c.concat(m.OPERAND(a[d],b[d]));else if("SID"===b)c=c.concat(m.NUMBER(a));else if("offset"===b)c=c.concat(m.NUMBER32(a));else if("number"===b)c=c.concat(m.NUMBER(a));else{if("real"!==b)throw new Error("Unknown operand type "+b);c=c.concat(m.REAL(a))}return c},m.OP=m.BYTE,n.OP=n.BYTE;var s="function"==typeof WeakMap&&new WeakMap;m.CHARSTRING=function(a){if(s){var b=s.get(a);if(void 0!==b)return b}for(var c=[],d=a.length,e=0;e<d;e+=1){var f=a[e];c=c.concat(m[f.type](f.value))}return s&&s.set(a,c),c},n.CHARSTRING=function(a){return m.CHARSTRING(a).length},m.OBJECT=function(a){var b=m[a.type];return i.argument(void 0!==b,"No encoding function for type "+a.type),b(a.value)},n.OBJECT=function(a){var b=n[a.type];return i.argument(void 0!==b,"No sizeOf function for type "+a.type),b(a.value)},m.TABLE=function(a){var b,c=[],d=a.fields.length,e=[],f=[];for(b=0;b<d;b+=1){var g=a.fields[b],h=m[g.type];i.argument(void 0!==h,"No encoding function for field type "+g.type+" ("+g.name+")");var j=a[g.name];void 0===j&&(j=g.value);var k=h(j);"TABLE"===g.type?(f.push(c.length),c=c.concat([0,0]),e.push(k)):c=c.concat(k)}for(b=0;b<e.length;b+=1){var l=f[b],n=c.length;i.argument(n<65536,"Table "+a.tableName+" too big."),c[l]=n>>8,c[l+1]=255&n,c=c.concat(e[b])}return c},n.TABLE=function(a){for(var b=0,c=a.fields.length,°äŒf +darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},h=/\s*/,i=/(\d{1,3})/,j=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,k=new RegExp(j.source+"%"),l={HEX3:/^#([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX4:/^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX6:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,HEX8:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,RGB:new RegExp(["^rgb\\(",i.source,",",i.source,",",i.source,"\\)$"].join(h.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",k.source,",",k.source,",",k.source,"\\)$"].join(h.source),"i"),RGBA:new RegExp(["^rgba\\(",i.source,",",i.source,",",i.source,",",j.source,"\\)$"].join(h.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",k.source,",",k.source,",",k.source,",",j.source,"\\)$"].join(h.source),"i"),HSL:new RegExp(["^hsl\\(",i.source,",",k.source,",",k.source,"\\)$"].join(h.source),"i"),HSLA:new RegExp(["^hsla\\(",i.source,",",k.source,",",k.source,",",j.source,"\\)$"].join(h.source),"i"),HSB:new RegExp(["^hsb\\(",i.source,",",k.source,",",k.source,"\\)$"].join(h.source),"i"),HSBA:new RegExp(["^hsba\\(",i.source,",",k.source,",",k.source,",",j.source,"\\)$"].join(h.source),"i")};d.Color._parseInputs=function(){var a=arguments.length,b=this._colorMode,c=this._colorMaxes,h=[];if(a>=3)return h[0]=arguments[0]/c[b][0],h[1]=arguments[1]/c[b][1],h[2]=arguments[2]/c[b][2],"number"==typeof arguments[3]?h[3]=arguments[3]/c[b][3]:h[3]=1,h=h.map(function(a){return Math.max(Math.min(a,1),0)}),b===e.HSL?f._hslaToRGBA(h):b===e.HSB?f._hsbaToRGBA(h):h;if(1===a&&"string"==typeof arguments[0]){var i=arguments[0].trim().toLowerCase();if(g[i])return d.Color._parseInputs.apply(this,[g[i]]);if(l.HEX3.test(i))return h=l.HEX3.exec(i).slice(1).map(function(a){return parseInt(a+a,16)/255}),h[3]=1,h;if(l.HEX6.test(i))return h=l.HEX6.exec(i).slice(1).map(function(a){return parseInt(a,16)/255}),h[3]=1,h;if(l.HEX4.test(i))return h=l.HEX4.exec(i).slice(1).map(function(a){return parseInt(a+a,16)/255});if(l.HEX8.test(i))return h=l.HEX8.exec(i).slice(1).map(function(a){return parseInt(a,16)/255});if(l.RGB.test(i))return h=l.RGB.exec(i).slice(1).map(function(a){return a/255}),h[3]=1,h;if(l.RGB_PERCENT.test(i))return h=l.RGB_PERCENT.exec(i).slice(1).map(function(a){return parseFloat(a)/100}),h[3]=1,h;if(l.RGBA.test(i))return h=l.RGBA.exec(i).slice(1).map(function(a,b){return 3===b?parseFloat(a):a/255});if(l.RGBA_PERCENT.test(i))return h=l.RGBA_PERCENT.exec(i).slice(1).map(function(a,b){return 3===b?parseFloat(a):parseFloat(a)/100});if(l.HSL.test(i)?(h=l.HSL.exec(i).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:parseInt(a,10)/100}),h[3]=1):l.HSLA.test(i)&&(h=l.HSLA.exec(i).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:3===b?parseFloat(a):parseInt(a,10)/100})),h=h.map(function(a){return Math.max(Math.min(a,1),0)}),h.length)return f._hslaToRGBA(h);if(l.HSB.test(i)?(h=l.HSB.exec(i).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:parseInt(a,10)/100}),h[3]=1):l.HSBA.test(i)&&(h=l.HSBA.exec(i).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:3===b?parseFloat(a):parseInt(a,10)/100})),h=h.map(function(a){return Math.max(Math.min(a,1),0)}),h.length)return f._hsbaToRGBA(h);h=[1,1,1,1]}else{if(1!==a&&2!==a||"number"!=typeof arguments[0])throw new Error(arguments+"is not a valid color representation.");h[0]=arguments[0]/c[b][2],h[1]=arguments[0]/c[b][2],h[2]=arguments[0]/c[b][2],"number"==typeof arguments[1]?h[3]=arguments[1]/c[b][3]:h[3]=1,h=h.map(function(a){return Math.max(Math.min(a,1),0)})}return h},b.exports=d.Color},{"../core/constants":54,"../core/core":55,"./color_conversion":47}],50:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("../core/constants");a("./p5.Color"),d.prototype.background=function(){return arguments[0]instanceof d.Image?this.image(arguments[0],0,0,this.width,this.height):this._renderer.background.apply(this._renderer,arguments),this},d.prototype.clear=function(){return this._renderer.clear(),this},d.prototype.colorMode=function(){if(arguments[0]===e.RGB||arguments[0]===e.HSB||arguments[0]===e.HSL){this._renderer._colorMode=arguments[0];var a=this._renderer._colorMaxes[this._renderer._colorMode];2===arguments.length?(a[0]=arguments[1],a[1]=arguments[1],a[2]=arguments[1],a[3]=arguments[1]):4===arguments.length?(a[0]=arguments[1],a[1]=arguments[2],a[2]=arguments[3]):5===arguments.length&&(a[0]=arguments[1],a[1]=arguments[2],a[2]=arguments[3],a[3]=arguments[4])}return this},d.prototype.fill=function(){return this._renderer._setProperty("_fillSet",!0),this._renderer._setProperty("_doFill",!0),this._renderer.fill.apply(this._renderer,arguments),this},d.prototype.noFill=function(){return this._renderer._setProperty("_doFill",!1),this},d.prototype.noStroke=function(){return this._renderer._setProperty("_doStroke",!1),this},d.prototype.stroke=function(){return this._renderer._setProperty("_strokeSet",!0),this._renderer._setProperty("_doStroke",!0),this._renderer.stroke.apply(this._renderer,arguments),this},b.exports=d},{"../core/constants":54,"../core/core":55,"./p5.Color":49}],51:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants"),f=a("./canvas");a("./error_helpers"),d.prototype.arc=function(a,b,c,f,g,h,i){for(var j=new Array(arguments.length),k=0;k<j.length;++k)j[k]=arguments[k];if(d._validateParameters("arc",j),!this._renderer._doStroke&&!this._renderer._doFill)return this;for(this._angleMode===e.DEGREES&&(g=this.radians(g),h=this.radians(h));g<0;)g+=e.TWO_PI;for(;h<0;)h+=e.TWO_PI;return g%=e.TWO_PI,h%=e.TWO_PI,h===g&&(h+=e.TWO_PI),g=g<=e.HALF_PI?Math.atan(c/f*Math.tan(g)):g>e.HALF_PI&&g<=3*e.HALF_PI?Math.atan(c/f*Math.tan(g))+e.PI:Math.atan(c/f*Math.tan(g))+e.TWO_PI,h=h<=e.HALF_PI?Math.atan(c/f*Math.tan(h)):h>e.HALF_PI&&h<=3*e.HALF_PI?Math.atan(c/f*Math.tan(h))+e.PI:Math.atan(c/f*Math.tan(h))+e.TWO_PI,g>h&&(h+=e.TWO_PI),c=Math.abs(c),f=Math.abs(f),this._renderer.arc(a,b,c,f,g,h,i),this},d.prototype.ellipse=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];if(3===a.length&&a.push(a[2]),d._validateParameters("ellipse",a),a[2]<0&&(a[2]=Math.abs(a[2])),a[3]<0&&(a[3]=Math.abs(a[3])),!this._renderer._doStroke&&!this._renderer._doFill)return this;var c=f.modeAdjust(a[0],a[1],a[2],a[3],this._renderer._ellipseMode);return a[0]=c.x,a[1]=c.y,a[2]=c.w,a[3]=c.h,this._renderer.ellipse(a),this},d.prototype.line=function(){if(!this._renderer._doStroke)return this;for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return d._validateParameters("line",a),this._renderer.isP3D?this._renderer.line(a[0],a[1],a[2],a[3],a[4],a[5]):this._renderer.line(a[0],a[1],a[2],a[3]),this},d.prototype.point=function(){if(!this._renderer._doStroke)return this;for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return d._validateParameters("point",a),this._renderer.isP3D?this._renderer.point(a[0],a[1],a[2]):this._renderer.point(a[0],a[1]),this},d.prototype.quad=function(){if(!this._renderer._doStroke&&!this._renderer._doFill)return this;for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return d._validateParameters("quad",a),this._renderer.isP3D?this._renderer.quad(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11]):this._renderer.quad(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]),this},d.prototype.rect=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];if(!this._renderer._doStroke&&!this._renderer._doFill)return this;d._validateParameters("rect",a);var c=f.modeAdjust(a[0],a[1],a[2],a[3],this._renderer._rectMode);return a[0]=c.x,a[1]=c.y,a[2]=c.w,a[3]=c.h,this._renderer.rect(a),this},d.prototype.triangle=function(){if(!this._renderer._doStroke&&!this._renderer._doFill)return this;for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];return d._validateParameters("triangle",a),this._renderer.triangle(a),this},b.exports=d},{"./canvas":53,"./constants":54,"./core":55,"./error_helpers":58}],52:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants");d.prototype.ellipseMode=function(a){return a!==e.CORNER&&a!==e.CORNERS&&a!==e.RADIUS&&a!==e.CENTER||(this._renderer._ellipseMode=a),this},d.prototype.noSmooth=function(){return this._renderer.noSmooth(),this},d.prototype.rectMode=function(a){return a!==e.CORNER&&a!==e.CORNERS&&a!==e.RADIUS&&a!==e.CENTER||(this._renderer._rectMode=a),this},d.prototype.smooth=function(){return this._renderer.smooth(),this},d.prototype.strokeCap=function(a){return a!==e.ROUND&&a!==e.SQUARE&&a!==e.PROJECT||this._renderer.strokeCap(a),this},d.prototype.strokeJoin=function(a){return a!==e.ROUND&&a!==e.BEVEL&&a!==e.MITER||this._renderer.strokeJoin(a),this},d.prototype.strokeWeight=function(a){return this._renderer.strokeWeight(a),this},b.exports=d},{"./constants":54,"./core":55}],53:[function(a,b,c){var d=a("./constants");b.exports={modeAdjust:function(a,b,c,e,f){return f===d.CORNER?{x:a,y:b,w:c,h:e}:f===d.CORNERS?{x:a,y:b,w:c-a,h:e-b}:f===d.RADIUS?{x:a-c,y:b-e,w:2*c,h:2*e}:f===d.CENTER?{x:a-.5*c,y:b-.5*e,w:c,h:e}:void 0},arcModeAdjust:function(a,b,c,e,f){return f===d.CORNER?{x:a+.5*c,y:b+.5*e,w:c,h:e}:f===d.CORNERS?{x:a,y:b,w:c+a,h:e+b}:f===d.RAD°äŒf +e.Element.prototype.dragLeave=function(a){return d("dragleave",a,this),this},e.Element.prototype.drop=function(a,b){function c(b){var c=new e.File(b);return function(b){c.data=b.target.result,a(c)}}return window.File&&window.FileReader&&window.FileList&&window.Blob?(d("dragover",function(a){a.stopPropagation(),a.preventDefault()},this),d("dragleave",function(a){a.stopPropagation(),a.preventDefault()},this),arguments.length>1&&d("drop",b,this),d("drop",function(a){a.stopPropagation(),a.preventDefault();for(var b=a.dataTransfer.files,d=0;d<b.length;d++){var e=b[d],f=new FileReader;f.onload=c(e),e.type.indexOf("text")>-1?f.readAsText(e):f.readAsDataURL(e)}},this)):console.log("The File APIs are not fully supported in this browser."),this},e.Element.prototype._setProperty=function(a,b){this[a]=b},b.exports=e.Element},{"./core":55}],61:[function(a,b,c){var d=a("./core"),e=a("./constants");d.Graphics=function(a,b,c,f){var g=c||e.P2D;this.canvas=document.createElement("canvas"),(this._userNode||document.body).appendChild(this.canvas),d.Element.call(this,this.canvas,f,!1),this._styles=[],this.width=a,this.height=b,this._pixelDensity=f._pixelDensity,g===e.WEBGL?this._renderer=new d.RendererGL(this.canvas,this,!1):this._renderer=new d.Renderer2D(this.canvas,this,!1),this._renderer.resize(a,b),this._renderer._applyDefaults(),f._elements.push(this);for(var h in d.prototype)this[h]||("function"==typeof d.prototype[h]?this[h]=d.prototype[h].bind(this):this[h]=d.prototype[h]);return this.name="p5.Graphics",this},d.Graphics.prototype=Object.create(d.Element.prototype),d.Graphics.prototype.remove=function(){this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt);for(var a in this._events)this.elt.removeEventListener(a,this._events[a])},b.exports=d.Graphics},{"./constants":54,"./core":55}],62:[function(a,b,c){function d(a){var b=0,c=0;if(a.offsetParent)do{b+=a.offsetLeft,c+=a.offsetTop}while(a=a.offsetParent);else b+=a.offsetLeft,c+=a.offsetTop;return[b,c]}var e=a("./core"),f=a("../core/constants");e.Renderer=function(a,b,c){e.Element.call(this,a,b),this.name="p5.Renderer",this.canvas=a,this._pInst=b,c?(this._isMainCanvas=!0,this._pInst._setProperty("_curElement",this),this._pInst._setProperty("canvas",this.canvas),this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height)):(this.canvas.style.display="none",this._styles=[]),this._textSize=12,this._textLeading=15,this._textFont="sans-serif",this._textStyle=f.NORMAL,this._textAscent=null,this._textDescent=null,this._rectMode=f.CORNER,this._ellipseMode=f.CENTER,this._curveTightness=0,this._imageMode=f.CORNER,this._tint=null,this._doStroke=!0,this._doFill=!0,this._strokeSet=!1,this._fillSet=!1,this._colorMode=f.RGB,this._colorMaxes={rgb:[255,255,255,255],hsb:[360,100,100,1],hsl:[360,100,100,1]}},e.Renderer.prototype=Object.create(e.Element.prototype),e.Renderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.elt.width=a*this._pInst._pixelDensity,this.elt.height=b*this._pInst._pixelDensity,this.elt.style.width=a+"px",this.elt.style.height=b+"px",this._isMainCanvas&&(this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height))},e.Renderer.prototype.textLeading=function(a){return arguments.length&&arguments[0]?(this._setProperty("_textLeading",a),this):this._textLeading},e.Renderer.prototype.textSize=function(a){return arguments.length&&arguments[0]?(this._setProperty("_textSize",a),this._setProperty("_textLeading",a*f._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},e.Renderer.prototype.textStyle=function(a){return arguments.length&&arguments[0]?(a!==f.NORMAL&&a!==f.ITALIC&&a!==f.BOLD||this._setProperty("_textStyle",a),this._applyTextProperties()):this._textStyle},e.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},e.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},e.Renderer.prototype._applyDefaults=function(){return this},e.Renderer.prototype._isOpenType=function(a){return"object"==typeof(a=a||this._textFont)&&a.font&&a.font.supported},e.Renderer.prototype._updateTextMetrics=function(){if(this._isOpenType())return this._setProperty("_textAscent",this._textFont._textAscent()),this._setProperty("_textDescent",this._textFont._textDescent()),this;var a=document.createElement("span");a.style.fontFamily=this._textFont,a.style.fontSize=this._textSize+"px",a.innerHTML="ABCjgq|";var b=document.createElement("div");b.style.display="inline-block",b.style.width="1px",b.style.height="0px";var c=document.createElement("div");c.appendChild(a),c.appendChild(b),c.style.height="0px",c.style.overflow="hidden",document.body.appendChild(c),b.style.verticalAlign="baseline";var e=d(b),f=d(a),g=e[1]-f[1];b.style.verticalAlign="bottom",e=d(b),f=d(a);var h=e[1]-f[1],i=h-g;return document.body.removeChild(c),this._setProperty("_textAscent",g),this._setProperty("_textDescent",i),this},b.exports=e.Renderer},{"../core/constants":54,"./core":55}],63:[function(a,b,c){var d=a("./core"),e=a("./canvas"),f=a("./constants"),g=a("../image/filters");a("./p5.Renderer");var h="rgba(0,0,0,0)";d.Renderer2D=function(a,b,c){return d.Renderer.call(this,a,b,c),this.name="p5.Renderer2D",this.drawingContext=this.canvas.getContext("2d"),this._pInst._setProperty("drawingContext",this.drawingContext),this},d.Renderer2D.prototype=Object.create(d.Renderer.prototype),d.Renderer2D.prototype._applyDefaults=function(){this._setFill(f._DEFAULT_FILL),this._setStroke(f._DEFAULT_STROKE),this.drawingContext.lineCap=f.ROUND,this.drawingContext.font="normal 12px sans-serif"},d.Renderer2D.prototype.resize=function(a,b){d.Renderer.prototype.resize.call(this,a,b),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity)},d.Renderer2D.prototype.background=function(){if(this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),arguments[0]instanceof d.Image)this._pInst.image(arguments[0],0,0,this.width,this.height);else{var a=this._getFill(),b=this._pInst.color.apply(this,arguments),c=b.toString();this._setFill(c),this.drawingContext.fillRect(0,0,this.width,this.height),this._setFill(a)}this.drawingContext.restore()},d.Renderer2D.prototype.clear=function(){this.drawingContext.clearRect(0,0,this.width,this.height)},d.Renderer2D.prototype.fill=function(){var a=this._pInst.color.apply(this,arguments);this._setFill(a.toString())},d.Renderer2D.prototype.stroke=function(){var a=this._pInst.color.apply(this,arguments);this._setStroke(a.toString())},d.Renderer2D.prototype.image=function(a,b,c,e,f,g,h,i,j){var k;try{this._tint&&(d.MediaElement&&a instanceof d.MediaElement&&a.loadPixels(),a.canvas&&(k=this._getTintedImageCanvas(a))),k||(k=a.canvas||a.elt),this.drawingContext.drawImage(k,b,c,e,f,g,h,i,j)}catch(a){if("NS_ERROR_NOT_AVAILABLE"!==a.name)throw a}},d.Renderer2D.prototype._getTintedImageCanvas=function(a){if(!a.canvas)return a;var b=g._toPixels(a.canvas),c=document.createElement("canvas");c.width=a.canvas.width,c.height=a.canvas.height;for(var d=c.getContext("2d"),e=d.createImageData(a.canvas.width,a.canvas.height),f=e.data,h=0;h<b.length;h+=4){var i=b[h],j=b[h+1],k=b[h+2],l=b[h+3];f[h]=i*this._tint[0]/255,f[h+1]=j*this._tint[1]/255,f[h+2]=k*this._tint[2]/255,f[h+3]=l*this._tint[3]/255}return d.putImageData(e,0,0),c},d.Renderer2D.prototype.blendMode=function(a){this.drawingContext.globalCompositeOperation=a},d.Renderer2D.prototype.blend=function(){var a=this.drawingContext.globalCompositeOperation,b=arguments[arguments.length-1],c=Array.prototype.slice.call(arguments,0,arguments.length-1);this.drawingContext.globalCompositeOperation=b,this._pInst?this._pInst.copy.apply(this._pInst,c):this.copy.apply(this,c),this.drawingContext.globalCompositeOperation=a},d.Renderer2D.prototype.copy=function(){var a,b,c,e,f,g,h,i,j;if(9===arguments.length)a=arguments[0],b=arguments[1],c=arguments[2],e=arguments[3],f=arguments[4],g=arguments[5],h=arguments[6],i=arguments[7],j=arguments[8];else{if(8!==arguments.length)throw new Error("Signature not supported");a=this._pInst,b=arguments[0],c=arguments[1],e=arguments[2],f=arguments[3],g=arguments[4],h=arguments[5],i=arguments[6],j=arguments[7]}d.Renderer2D._copyHelper(a,b,c,e,f,g,h,i,j)},d.Renderer2D._copyHelper=function(a,b,c,d,e,f,g,h,i){a.loadPixels();var j=a.canvas.width/a.width;this.drawingContext.drawImage(a.canvas,j*b,j*c,j*d,j*e,f,g,h,i)},d.Renderer2D.prototype.get=function(a,b,c,e){if(void 0===a&&void 0===b&&void 0===c&&void 0===e?(a=0,b=0,c=this.width,e=this.height):void 0===c&&void 0===e&&(c=1,e=1),a+c<0||b+e<0||a>this.width||b>this.height)return[0,0,0,255];var f=this._pInst||this;f.loadPixels();var g=f._pixelDensity;a=Math.floor(a),b=Math.floor(b),c=Math.floor(c),e=Math.floor(e);var h=a*g,i=b*g;if(1===c&&1===e){var j=this.drawingContext.getImageData(h,i,1,1).data;return[j[0],j[1],j[2],j[3]]}var k=Math.min(c,f.width),l=Math.min(e,f.height),m=k*g,n=l*g,o=new d.Image(k,l);return o.canvas.getContext("2d").drawImage(this.canvas,h,i,m,n,0,0,k,l),o},d.Renderer2D.prototype.loadPixels=function(){var a=this._pixelDensity||this._pInst._pixelDensity,b=this.width*a,c=this.height*a,d=this.drawingContext.getImageData(0,0,b,c);this._pInst?(this._pInst._setProperty("imageData",d),this._pInst._setProperty("pixels",d.data)):(this._setProperty("imageData",d),this._setProperty("pixels",d.data))},d.Renderer2D.prototype.set=function(a,b,c){if(a=Math.floor(a),b=Math.floor(b),c instanceof d.Image)this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),this.drawingContext.drawImage(c.canvas,a,b),this.loadPixels.call(this._pInst),this.drawingContext.restore();else{var e=this._pInst||this,f=0,g=0,h=0,i=0,j=4*(b*e._pixelDensity*(this.width*e._pixelDensity)+a*e._pixelDensity);if(e.imageData||e.loadPixels.call(e),"number"==typeof c)j<e.pixels.length&&(f=c,g=c,h=c,i=255);else if(c instanceof Array){if(c.length<4)throw new Error("pixel array must be of the form [R, G, B, A]");j<e.pixels.length&&(f=c[0],g=c[1],h=c[2],i=c[3])}else c instanceof d.Color&&j<e.pixels.length&&(f=c.levels[0],g=c.levels[1],h=c.levels[2],i=c.levels[3]);for(var k=0;k<e._pixelDensity;k++)for(var l=0;l<e._pixelDensity;l++)j=4*((b*e._pixelDensity+l)*this.width*e._pixelDensity+(a*e._pixelDensity+k)),e.pixels[j]=f,e.pixels[j+1]=g,e.pixels[j+2]=h,e.pixels[j+3]=i}},d.Renderer2D.prototype.updatePixels=function(a,b,c,d){var e=this._pixelDensity||this._pInst._pixelDensity;void 0===a&&void 0===b&&void 0===c&&void 0===d&&(a=0,b=0,c=this.width,d=this.height),c*=e,d*=e,this._pInst?this.drawingContext.putImageData(this._pInst.imageData,a,b,0,0,c,d):this.drawingContext.putImageData(this.imageData,a,b,0,0,c,d)},d.Renderer2D.prototype._acuteArcToBezier=function(a,b){var c=b/2,d=Math.cos(c),e=Math.sin(c),f=1/Math.tan(c),g=a+c,h=Math.cos(g),i=Math.sin(g),j=(4-d)/3,k=e+(d-j)*f;return{ax:Math.cos(a),ay:Math.sin(a),bx:j*h+k*i,by:j*i-k*h,cx:j*h-k*i,cy:j*i+k*h,dx:Math.cos(a+b),dy:Math.sin(a+b)}},d.Renderer2D.prototype.arc=function(a,b,c,d,g,h,i){for(var j=this.drawingContext,k=e.arcModeAdjust(a,b,c,d,this._ellipseMode),l=k.w/2,m=k.h/2,n=1e-5,o=0,p=[];h-g>n;)o=Math.min(h-g,f.HALF_PI),p.push(this._acuteArcToBezier(g,o)),g+=o;return this._doFill&&(j.beginPath(),p.forEach(function(a,b){0===b&&j.moveTo(k.x+a.ax*l,k.y+a.ay*m),j.bezierCurveTo(k.x+a.bx*l,k.y+a.by*m,k.x+a.cx*l,k.y+a.cy*m,k.x+a.dx*l,k.y+a.dy*m)}),i!==f.PIE&&null!=i||j.lineTo(k.x,k.y),j.closePath(),j.fill()),this._doStroke&&(j.beginPath(),p.forEach(function(a,b){0===b&&j.moveTo(k.x+a.ax*l,k.y+a.ay*m),j.bezierCurveTo(k.x+a.bx*l,k.y+a.by*m,k.x+a.cx*l,k.y+a.cy*m,k.x+a.dx*l,k.y+a.dy*m)}),i===f.PIE?(j.lineTo(k.x,k.y),j.closePath()):i===f.CHORD&&j.closePath(),j.stroke()),this},d.Renderer2D.prototype.ellipse=function(a){var b=this.drawingContext,c=this._doFill,d=this._doStroke,e=a[0],f=a[1],g=a[2],i=a[3];if(c&&!d){if(this._getFill()===h)return this}else if(!c&&d&&this._getStroke()===h)return th°äŒf +d.prototype.endShape=function(a){if(this._renderer.isP3D)this._renderer.endShape(a,j,i,k,l,f);else{if(0===g.length)return this;if(!this._renderer._doStroke&&!this._renderer._doFill)return this;var b=a===e.CLOSE;b&&!l&&g.push(g[0]),this._renderer.endShape(a,g,j,i,k,l,f),j=!1,i=!1,k=!1,l=!1,m=!0,b&&g.pop()}return this},d.prototype.quadraticVertex=function(a,b,c,d){if(this._contourInited){var f={};return f.x=a,f.y=b,f.x3=c,f.y3=d,f.type=e.QUADRATIC,this._contourVertices.push(f),this}if(!(g.length>0))throw"vertex() must be used once before calling quadraticVertex()";k=!0;for(var i=[],j=0;j<arguments.length;j++)i[j]=arguments[j];return i.isVert=!1,l?h.push(i):g.push(i),this},d.prototype.vertex=function(a,b,c){if(this._renderer.isP3D)this._renderer.vertex(a,b,c);else{var d=[];d.isVert=!0,d[0]=a,d[1]=b,d[2]=0,d[3]=0,d[4]=0,d[5]=this._renderer._getFill(),d[6]=this._renderer._getStroke(),c&&(d.moveTo=c),l?(0===h.length&&(d.moveTo=!0),h.push(d)):g.push(d)}return this},b.exports=d},{"./constants":54,"./core":55}],69:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.createStringDict=function(){return new d.StringDict(arguments[0],arguments[1])},d.prototype.createNumberDict=function(){return new d.NumberDict(arguments[0],arguments[1])},d.TypedDict=function(){return this.data={},arguments[0][0]instanceof Object?this.data=arguments[0][0]:this.data[arguments[0][0]]=arguments[0][1],this},d.TypedDict.prototype.size=function(){return Object.keys(this.data).length},d.TypedDict.prototype.hasKey=function(a){return this.data.hasOwnProperty(a)},d.TypedDict.prototype.get=function(a){if(this.data.hasOwnProperty(a))return this.data[a];console.log(a+" does not exist in this Dictionary")},d.TypedDict.prototype.set=function(a,b){2===arguments.length&&(this.data.hasOwnProperty(a)?this.data[a]=b:this.create(a,b))},d.TypedDict.prototype._addObj=function(a){for(var b in a)this._validate(a[b])?this.data[b]=a[b]:console.log("Those values dont work for this dictionary type.")},d.TypedDict.prototype.create=function(){if(1===arguments.length&&arguments[0]instanceof Object)this._addObj(arguments[0]);else if(2===arguments.length){var a={};a[arguments[0]]=arguments[1],this._addObj(a)}else console.log("In order to create a new Dictionary entry you must pass an object or a key, value pair")},d.TypedDict.prototype.clear=function(){this.data={}},d.TypedDict.prototype.remove=function(a){if(!this.data.hasOwnProperty(a))throw a+" does not exist in this Dictionary";delete this.data[a]},d.TypedDict.prototype.print=function(){for(var a in this.data)console.log("key:"+a+" value:"+this.data[a])},d.TypedDict.prototype.saveTable=function(){var a="";for(var b in this.data)a+=b+","+this.data[b]+"\n";var c=arguments[0]||"mycsv",e=new Blob([a],{type:"text/csv"}),f=window.URL.createObjectURL(e);d.prototype.downloadFile(f,c,"csv")},d.TypedDict.prototype.saveJSON=function(a,b){d.prototype.saveJSON(this.data,a,b)},d.TypedDict.prototype._validate=function(a,b){return!0},d.StringDict=function(){d.TypedDict.call(this,arguments)},d.StringDict.prototype=Object.create(d.TypedDict.prototype),d.StringDict.prototype._validate=function(a){return"string"==typeof a},d.NumberDict=function(){d.TypedDict.call(this,arguments)},d.NumberDict.prototype=Object.create(d.TypedDict.prototype),d.NumberDict.prototype._validate=function(a){return"number"==typeof a},d.NumberDict.prototype.add=function(a,b){this.data.hasOwnProperty(a)?this.data[a]+=b:console.log("The key - "+a+" does not exist in this dictionary.")},d.NumberDict.prototype.sub=function(a,b){this.add(a,-b)},d.NumberDict.prototype.mult=function(a,b){this.data.hasOwnProperty(a)?this.data[a]*=b:console.log("The key - "+a+" does not exist in this dictionary.")},d.NumberDict.prototype.div=function(a,b){this.data.hasOwnProperty(a)?this.data[a]/=b:console.log("The key - "+a+" does not exist in this dictionary.")},d.NumberDict.prototype._valueTest=function(a){if(0===Object.keys(this.data).length)throw"Unable to search for a minimum or maximum value on an empty NumberDict";if(1===Object.keys(this.data).length)return this.data[Object.keys(this.data)[0]];var b=this.data[Object.keys(this.data)[0]];for(var c in this.data)this.data[c]*a<b*a&&(b=this.data[c]);return b},d.NumberDict.prototype.minValue=function(){return this._valueTest(1)},d.NumberDict.prototype.maxValue=function(){return this._valueTest(-1)},d.NumberDict.prototype._keyTest=function(a){if(0===Object.keys(this.data).length)throw"Unable to use minValue on an empty NumberDict";if(1===Object.keys(this.data).length)return Object.keys(this.data)[0];for(var b=Object.keys(this.data)[0],c=1;c<Object.keys(this.data).length;c++)Object.keys(this.data)[c]*a<b*a&&(b=Object.keys(this.data)[c]);return b},d.NumberDict.prototype.minKey=function(){return this._keyTest(1)},d.NumberDict.prototype.maxKey=function(){return this._keyTest(-1)},b.exports=d.TypedDict},{"../core/core":55}],70:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.deviceOrientation=void 0,d.prototype.accelerationX=0,d.prototype.accelerationY=0,d.prototype.accelerationZ=0,d.prototype.pAccelerationX=0,d.prototype.pAccelerationY=0,d.prototype.pAccelerationZ=0,d.prototype._updatePAccelerations=function(){this._setProperty("pAccelerationX",this.accelerationX),this._setProperty("pAccelerationY",this.accelerationY),this._setProperty("pAccelerationZ",this.accelerationZ)},d.prototype.rotationX=0,d.prototype.rotationY=0,d.prototype.rotationZ=0,d.prototype.pRotationX=0,d.prototype.pRotationY=0,d.prototype.pRotationZ=0;var e,f,g,h=0,i=0,j=0,k="clockwise",l="clockwise",m="clockwise";d.prototype._updatePRotations=function(){this._setProperty("pRotationX",this.rotationX),this._setProperty("pRotationY",this.rotationY),this._setProperty("pRotationZ",this.rotationZ)},d.prototype.turnAxis=void 0;var n=.5,o=30;d.prototype.setMoveThreshold=function(a){"number"==typeof a&&(n=a)},d.prototype.setShakeThreshold=function(a){"number"==typeof a&&(o=a)},d.prototype._ondeviceorientation=function(a){this._updatePRotations(),this._setProperty("rotationX",a.beta),this._setProperty("rotationY",a.gamma),this._setProperty("rotationZ",a.alpha),this._handleMotion()},d.prototype._ondevicemotion=function(a){this._updatePAccelerations(),this._setProperty("accelerationX",2*a.acceleration.x),this._setProperty("accelerationY",2*a.acceleration.y),this._setProperty("accelerationZ",2*a.acceleration.z),this._handleMotion()},d.prototype._handleMotion=function(){90===window.orientation||window.orientation===-90?this._setProperty("deviceOrientation","landscape"):0===window.orientation?this._setProperty("deviceOrientation","portrait"):void 0===window.orientation&&this._setProperty("deviceOrientation","undefined");var a=this.deviceMoved||window.deviceMoved;"function"==typeof a&&(Math.abs(this.accelerationX-this.pAccelerationX)>n||Math.abs(this.accelerationY-this.pAccelerationY)>n||Math.abs(this.accelerationZ-this.pAccelerationZ)>n)&&a();var b=this.deviceTurned||window.deviceTurned;if("function"==typeof b){var c=this.rotationX+180,d=this.pRotationX+180,p=h+180;c-d>0&&c-d<270||c-d<-270?k="clockwise":(c-d<0||c-d>270)&&(k="counter-clockwise"),k!==e&&(p=c),Math.abs(c-p)>90&&Math.abs(c-p)<270&&(p=c,this._setProperty("turnAxis","X"),b()),e=k,h=p-180;var q=this.rotationY+180,r=this.pRotationY+180,s=i+180;q-r>0&&q-r<270||q-r<-270?l="clockwise":(q-r<0||q-this.pRotationY>270)&&(l="counter-clockwise"),l!==f&&(s=q),Math.abs(q-s)>90&&Math.abs(q-s)<270&&(s=q,this._setProperty("turnAxis","Y"),b()),f=l,i=s-180,this.rotationZ-this.pRotationZ>0&&this.rotationZ-this.pRotationZ<270||this.rotationZ-this.pRotationZ<-270?m="clockwise":(this.rotationZ-this.pRotationZ<0||this.rotationZ-this.pRotationZ>270)&&(m="counter-clockwise"),m!==g&&(j=this.rotationZ),Math.abs(this.rotationZ-j)>90&&Math.abs(this.rotationZ-j)<270&&(j=this.rotationZ,this._setProperty("turnAxis","Z"),b()),g=m,this._setProperty("turnAxis",void 0)}var t=this.deviceShaken||window.deviceShaken;if("function"==typeof t){var u,v;null!==this.pAccelerationX&&(u=Math.abs(this.accelerationX-this.pAccelerationX),v=Math.abs(this.accelerationY-this.pAccelerationY)),u+v>o&&t()}},b.exports=d},{"../core/core":55}],71:[function(a,b,c){"use strict";function d(){for(var a in f)if(f.hasOwnProperty(a)&&f[a]===!0)return!0;return!1}var e=a("../core/core"),f={};e.prototype.isKeyPressed=!1,e.prototype.keyIsPressed=!1,e.prototype.key="",e.prototype.keyCode=0,e.prototype._onkeydown=function(a){if(!f[a.which]){this._setProperty("isKeyPressed",!0),this._setProperty("keyIsPressed",!0),this._setProperty("keyCode",a.which),f[a.which]=!0;var b=String.fromCharCode(a.which);b||(b=a.which),this._setProperty("key",b);var c=this.keyPressed||window.keyPressed;if("function"==typeof c&&!a.charCode){c(a)===!1&&a.preventDefault()}}},e.prototype._onkeyup=function(a){var b=this.keyReleased||window.keyReleased;f[a.which]=!1,d()||(this._setProperty("isKeyPressed",!1),this._setProperty("keyIsPressed",!1)),this._setProperty("_lastKeyCodeTyped",null);var c=String.fromCharCode(a.which);if(c||(c=a.which),this._setProperty("key",c),this._setProperty("keyCode",a.which),"function"==typeof b){b(a)===!1&&a.preventDefault()}},e.prototype._onkeypress=function(a){if(a.which!==this._lastKeyCodeTyped){this._setProperty("keyCode",a.which),this._setProperty("_lastKeyCodeTyped",a.which),this._setProperty("key",String.fromCharCode(a.which));var b=this.keyTyped||window.keyTyped;if("function"==typeof b){b(a)===!1&&a.preventDefault()}}},e.prototype._onblur=function(a){f={}},e.prototype.keyIsDown=function(a){return f[a]},b.exports=e},{"../core/core":55}],72:[function(a,b,c){"use strict";function d(a,b,c,d){d&&!d.clientX&&(d.touches?d=d.touches[0]:d.changedTouches&&(d=d.changedTouches[0]));var e=a.getBoundingClientRect(),f=a.scrollWidth/b,g=a.scrollHeight/c;return{x:(d.clientX-e.left)/f,y:(d.clientY-e.top)/g,winX:d.clientX,winY:d.clientY,id:d.identifier}}var e=a("../core/core"),f=a("../core/constants");e.prototype._hasMouseInteracted=!1,e.prototype.mouseX=0,e.prototype.mouseY=0,e.prototype.pmouseX=0,e.prototype.pmouseY=0,e.prototype.winMouseX=0,e.prototype.winMouseY=0,e.prototype.pwinMouseX=0,e.prototype.pwinMouseY=0,e.prototype.mouseButton=0,e.prototype.mouseIsPressed=!1,e.prototype._updateNextMouseCoords=function(a){if(null!==this._curElement&&(!a.touches||a.touches.length>0)){var b=d(this._curElement.elt,this.width,this.height,a);this._setProperty("mouseX",b.x),this._setProperty("mouseY",b.y),this._setProperty("winMouseX",b.winX),this._setProperty("winMouseY",b.winY)}this._hasMouseInteracted||(this._updateMouseCoords(),this._setProperty("_hasMouseInteracted",!0))},e.prototype._updateMouseCoords=function(){this._setProperty("pmouseX",this.mouseX),this._setProperty("pmouseY",this.mouseY),this._setProperty("pwinMouseX",this.winMouseX),this._setProperty("pwinMouseY",this.winMouseY)},e.prototype._setMouseButton=function(a){1===a.button?this._setProperty("mouseButton",f.CENTER):2===a.button?this._setProperty("mouseButton",f.RIGHT):this._setProperty("mouseButton",f.LEFT)},e.prototype._onmousemove=function(a){var b=this._isGlobal?window:this;this._updateNextMouseCoords(a),this.mouseIsPressed?"function"==typeof b.mouseDragged?b.mouseDragged(a)===!1&&a.preventDefault():"function"==typeof b.touchMoved&&b.touchMoved(a)===!1&&a.preventDefault():"function"==typeof b.mouseMoved&&b.mouseMoved(a)===!1&&a.preventDefault()},e.prototype._onmousedown=function(a){var b=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._setMouseButton(a),this._updateNextMouseCoords(a),"function"==typeof b.mousePressed?b.mousePressed(a)===!1&&a.preventDefault():"function"==typeof b.touchStarted&&b.touchStarted(a)===!1&&a.preventDefault()},e.prototype._onmouseup=function(a){var b=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!1),"function"==typeof b.mouseReleased?b.mouseReleased(a)===!1&&a.preventDefault():"function"==typeof b.touchEnded&&b.touchEnded(a)===!1&&a.preventDefault()},e.prototype._ondragend=e.prototype._onmouseup,e.prototype._ondragover=e.prototype._onmousemove,e.prototype._onclick=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.mouseClicked){b.mouseClicked(a)===!1&&a.preventDefault()}},e.prototype._doubleClicked=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.doubleClicked){b.ondblclick(a)===!1&&a.preventDefault()}},e.prototype._onwheel=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.mouseWheel){a.delta=a.deltaY;b.mouseWheel(a)===!1&&a.preventDefault()}},b.exports=e},{"../core/constants":54,"../core/core":55}],73:[function(a,b,c){"use strict";function d(a,b,c,d,e){e=e||0;var f=a.getBoundingClientRect(),g=a.scrollWidth/b,h=a.scrollHeight/c,i=d.touches[e]||d.changedTouches[e];return{x:(i.clientX-f.left)/g,y:(i.clientY-f.top)/h,winX:i.clientX,winY:i.clientY,id:i.identifier}}var e=a("../core/core");e.prototype.touches=[],e.prototype._updateTouchCoords=function(a){if(null!==this._°äŒf +;d=c?JSON.stringify(a):JSON.stringify(a,void 0,2),this.saveStrings(d.split("\n"),b,"json")},h.prototype.saveJSONObject=h.prototype.saveJSON,h.prototype.saveJSONArray=h.prototype.saveJSON,h.prototype.saveStrings=function(a,b,c){for(var d=c||"txt",e=this.createWriter(b,d),f=0;f<a.length;f++)a.length,e.print(a[f]);e.close(),e.flush()},h.prototype.saveTable=function(a,b,c){var d;d=void 0===c?b.substring(b.lastIndexOf(".")+1,b.length):c;var f=this.createWriter(b,d),g=a.columns,h=",";if("tsv"===d&&(h="\t"),"html"!==d){if("0"!==g[0]){for(var i=0;i<g.length;i++)i<g.length-1?f.write(g[i]+h):f.write(g[i]);f.write("\n")}for(var j=0;j<a.rows.length;j++){var k;for(k=0;k<a.rows[j].arr.length;k++)k<a.rows[j].arr.length-1?f.write(a.rows[j].arr[k]+h):(a.rows.length,f.write(a.rows[j].arr[k]));f.write("\n")}}else{f.print("<html>"),f.print("<head>");var l=' <meta http-equiv="content-type" content';if(l+='="text/html;charset=utf-8" />',f.print(l),f.print("</head>"),f.print("<body>"),f.print(" <table>"),"0"!==g[0]){f.print(" <tr>");for(var m=0;m<g.length;m++){var n=e(g[m]);f.print(" <td>"+n),f.print(" </td>")}f.print(" </tr>")}for(var o=0;o<a.rows.length;o++){f.print(" <tr>");for(var p=0;p<a.columns.length;p++){var q=a.rows[o].getString(p),r=e(q);f.print(" <td>"+r),f.print(" </td>")}f.print(" </tr>")}f.print(" </table>"),f.print("</body>"),f.print("</html>")}f.close(),f.flush()},h.prototype.writeFile=function(a,b,c){var d="application/octet-stream";h.prototype._isSafari()&&(d="text/plain");var e=new Blob(a,{type:d}),f=window.URL.createObjectURL(e);h.prototype.downloadFile(f,b,c)},h.prototype.downloadFile=function(a,b,c){var d=f(b,c),e=d[0],i=d[1],j=document.createElement("a");if(j.href=a,j.download=e,j.onclick=function(a){g(a),a.stopPropagation()},j.style.display="none",document.body.appendChild(j),h.prototype._isSafari()){var k="Hello, Safari user! To download this file...\n";k+="1. Go to File --> Save As.\n",k+='2. Choose "Page Source" as the Format.\n',k+='3. Name it with this extension: ."'+i+'"',alert(k)}j.click(),a=null},h.prototype._checkFileExtension=f,h.prototype._isSafari=function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0},b.exports=h},{"../core/core":55,"../core/error_helpers":58,"es6-promise":5,"fetch-jsonp":6,"whatwg-fetch":45}],80:[function(a,b,c){"use strict";var d=a("../core/core");d.Table=function(a){this.columns=[],this.rows=[],this.name="p5.Table"},d.Table.prototype.addRow=function(a){var b=a||new d.TableRow;if(void 0===b.arr||void 0===b.obj)throw"invalid TableRow: "+b;return b.table=this,this.rows.push(b),b},d.Table.prototype.removeRow=function(a){this.rows[a].table=null;var b=this.rows.splice(a+1,this.rows.length);this.rows.pop(),this.rows=this.rows.concat(b)},d.Table.prototype.getRow=function(a){return this.rows[a]},d.Table.prototype.getRows=function(){return this.rows},d.Table.prototype.findRow=function(a,b){if("string"==typeof b){for(var c=0;c<this.rows.length;c++)if(this.rows[c].obj[b]===a)return this.rows[c]}else for(var d=0;d<this.rows.length;d++)if(this.rows[d].arr[b]===a)return this.rows[d];return null},d.Table.prototype.findRows=function(a,b){var c=[];if("string"==typeof b)for(var d=0;d<this.rows.length;d++)this.rows[d].obj[b]===a&&c.push(this.rows[d]);else for(var e=0;e<this.rows.length;e++)this.rows[e].arr[b]===a&&c.push(this.rows[e]);return c},d.Table.prototype.matchRow=function(a,b){if("number"==typeof b){for(var c=0;c<this.rows.length;c++)if(this.rows[c].arr[b].match(a))return this.rows[c]}else for(var d=0;d<this.rows.length;d++)if(this.rows[d].obj[b].match(a))return this.rows[d];return null},d.Table.prototype.matchRows=function(a,b){var c=[];if("number"==typeof b)for(var d=0;d<this.rows.length;d++)this.rows[d].arr[b].match(a)&&c.push(this.rows[d]);else for(var e=0;e<this.rows.length;e++)this.rows[e].obj[b].match(a)&&c.push(this.rows[e]);return c},d.Table.prototype.getColumn=function(a){var b=[];if("string"==typeof a)for(var c=0;c<this.rows.length;c++)b.push(this.rows[c].obj[a]);else for(var d=0;d<this.rows.length;d++)b.push(this.rows[d].arr[a]);return b},d.Table.prototype.clearRows=function(){delete this.rows,this.rows=[]},d.Table.prototype.addColumn=function(a){var b=a||null;this.columns.push(b)},d.Table.prototype.getColumnCount=function(){return this.columns.length},d.Table.prototype.getRowCount=function(){return this.rows.length},d.Table.prototype.removeTokens=function(a,b){for(var c=function(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},d=[],e=0;e<a.length;e++)d.push(c(a.charAt(e)));var f=new RegExp(d.join("|"),"g");if(void 0===b)for(var g=0;g<this.columns.length;g++)for(var h=0;h<this.rows.length;h++){var i=this.rows[h].arr[g];i=i.replace(f,""),this.rows[h].arr[g]=i,this.rows[h].obj[this.columns[g]]=i}else if("string"==typeof b)for(var j=0;j<this.rows.length;j++){var k=this.rows[j].obj[b];k=k.replace(f,""),this.rows[j].obj[b]=k;var l=this.columns.indexOf(b);this.rows[j].arr[l]=k}else for(var m=0;m<this.rows.length;m++){var n=this.rows[m].arr[b];n=n.replace(f,""),this.rows[m].arr[b]=n,this.rows[m].obj[this.columns[b]]=n}},d.Table.prototype.trim=function(a){var b=new RegExp(" ","g");if(void 0===a)for(var c=0;c<this.columns.length;c++)for(var d=0;d<this.rows.length;d++){var e=this.rows[d].arr[c];e=e.replace(b,""),this.rows[d].arr[c]=e,this.rows[d].obj[this.columns[c]]=e}else if("string"==typeof a)for(var f=0;f<this.rows.length;f++){var g=this.rows[f].obj[a];g=g.replace(b,""),this.rows[f].obj[a]=g;var h=this.columns.indexOf(a);this.rows[f].arr[h]=g}else for(var i=0;i<this.rows.length;i++){var j=this.rows[i].arr[a];j=j.replace(b,""),this.rows[i].arr[a]=j,this.rows[i].obj[this.columns[a]]=j}},d.Table.prototype.removeColumn=function(a){var b,c;"string"==typeof a?(b=a,c=this.columns.indexOf(a),console.log("string")):(c=a,b=this.columns[a]);var d=this.columns.splice(c+1,this.columns.length);this.columns.pop(),this.columns=this.columns.concat(d);for(var e=0;e<this.rows.length;e++){var f=this.rows[e].arr,g=f.splice(c+1,f.length);f.pop(),this.rows[e].arr=f.concat(g),delete this.rows[e].obj[b]}},d.Table.prototype.set=function(a,b,c){this.rows[a].set(b,c)},d.Table.prototype.setNum=function(a,b,c){this.rows[a].setNum(b,c)},d.Table.prototype.setString=function(a,b,c){this.rows[a].setString(b,c)},d.Table.prototype.get=function(a,b){return this.rows[a].get(b)},d.Table.prototype.getNum=function(a,b){return this.rows[a].getNum(b)},d.Table.prototype.getString=function(a,b){return this.rows[a].getString(b)},d.Table.prototype.getObject=function(a){for(var b,c,d={},e=0;e<this.rows.length;e++)if(b=this.rows[e].obj,"string"==typeof a){if(!(this.columns.indexOf(a)>=0))throw'This table has no column named "'+a+'"';c=b[a],d[c]=b}else d[e]=this.rows[e].obj;return d},d.Table.prototype.getArray=function(){for(var a=[],b=0;b<this.rows.length;b++)a.push(this.rows[b].arr);return a},b.exports=d},{"../core/core":55}],81:[function(a,b,c){"use strict";var d=a("../core/core");d.TableRow=function(a,b){var c=[],d={};a&&(b=b||",",c=a.split(b));for(var e=0;e<c.length;e++){var f=e,g=c[e];d[f]=g}this.arr=c,this.obj=d,this.table=null,this.name="p5.TableRow"},d.TableRow.prototype.set=function(a,b){if("string"==typeof a){var c=this.table.columns.indexOf(a);if(!(c>=0))throw'This table has no column named "'+a+'"';this.obj[a]=b,this.arr[c]=b}else{if(!(a<this.table.columns.length))throw"Column #"+a+" is out of the range of this table";this.arr[a]=b;var d=this.table.columns[a];this.obj[d]=b}},d.TableRow.prototype.setNum=function(a,b){var c=parseFloat(b);this.set(a,c)},d.TableRow.prototype.setString=function(a,b){var c=b.toString();this.set(a,c)},d.TableRow.prototype.get=function(a){return"string"==typeof a?this.obj[a]:this.arr[a]},d.TableRow.prototype.getNum=function(a){var b;if(b="string"==typeof a?parseFloat(this.obj[a]):parseFloat(this.arr[a]),"NaN"===b.toString())throw"Error: "+this.obj[a]+" is NaN (Not a Number)";return b},d.TableRow.prototype.getString=function(a){return"string"==typeof a?this.obj[a].toString():this.arr[a].toString()},b.exports=d},{"../core/core":55}],82:[function(a,b,c){"use strict";var d=a("../core/core");d.XML=function(){this.name=null,this.attributes={},this.children=[],this.parent=null,this.content=null,this.name="p5.XML"},d.XML.prototype.getParent=function(){return this.parent},d.XML.prototype.getName=function(){return this.name},d.XML.prototype.setName=function(a){this.name=a},d.XML.prototype.hasChildren=function(){return this.children.length>0},d.XML.prototype.listChildren=function(){return this.children.map(function(a){return a.name})},d.XML.prototype.getChildren=function(a){return a?this.children.filter(function(b){return b.name===a}):this.children},d.XML.prototype.getChild=function(a){return"string"==typeof a?this.children.find(function(b){return b.name===a}):this.children[a]},d.XML.prototype.addChild=function(a){a instanceof d.XML&&this.children.push(a)},d.XML.prototype.removeChild=function(a){var b=-1;if("string"==typeof a){for(var c=0;c<this.children.length;c++)if(this.children[c].name===a){b=c;break}}else b=a;b!==-1&&this.children.splice(b,1)},d.XML.prototype.getAttributeCount=function(){return Object.keys(this.attributes).length},d.XML.prototype.listAttributes=function(){return Object.keys(this.attributes)},d.XML.prototype.hasAttribute=function(a){return!!this.attributes[a]},d.XML.prototype.getNum=function(a,b){return Number(this.attributes[a])||b||0},d.XML.prototype.getString=function(a,b){return String(this.attributes[a])||b||null},d.XML.prototype.setAttribute=function(a,b){this.attributes[a]&&(this.attributes[a]=b)},d.XML.prototype.getContent=function(a){return this.content||a||null},d.XML.prototype.setContent=function(a){this.children.length||(this.content=a)},d.XML.prototype._setCont=function(a){var b;b=a,b=b.replace(/\s\s+/g,","),this.content=b},d.XML.prototype._setAttributes=function(a){var b,c={};for(b=0;b<a.attributes.length;b++)c[a.attributes[b].nodeName]=a.attributes[b].nodeValue;this.attributes=c},b.exports=d},{"../core/core":55}],83:[function(a,b,c){"use strict";function d(a,b,c){if("function"==typeof Math.hypot)return Math.hypot.apply(null,arguments);for(var d=arguments.length,e=[],f=0,g=0;g<d;g++){var h=arguments[g];if((h=+h)===1/0||h===-(1/0))return 1/0;h=Math.abs(h),h>f&&(f=h),e[g]=h}0===f&&(f=1);for(var i=0,j=0,k=0;k<d;k++){var l=e[k]/f,m=l*l-j,n=i+m;j=n-i-m,i=n}return Math.sqrt(i)*f}var e=a("../core/core");e.prototype.abs=Math.abs,e.prototype.ceil=Math.ceil,e.prototype.constrain=function(a,b,c){return Math.max(Math.min(a,c),b)},e.prototype.dist=function(a,b,c,e,f,g){return 4===arguments.length?d(c-a,e-b):6===arguments.length?d(e-a,f-b,g-c):void 0},e.prototype.exp=Math.exp,e.prototype.floor=Math.floor,e.prototype.lerp=function(a,b,c){return c*(b-a)+a},e.prototype.log=Math.log,e.prototype.mag=function(a,b){return d(a,b)},e.prototype.map=function(a,b,c,d,e){return(a-b)/(c-b)*(e-d)+d},e.prototype.max=function(){return arguments[0]instanceof Array?Math.max.apply(null,arguments[0]):Math.max.apply(null,arguments)},e.prototype.min=function(){return arguments[0]instanceof Array?Math.min.apply(null,arguments[0]):Math.min.apply(null,arguments)},e.prototype.norm=function(a,b,c){return this.map(a,b,c,0,1)},e.prototype.pow=Math.pow,e.prototype.round=Math.round,e.prototype.sq=function(a){return a*a},e.prototype.sqrt=Math.sqrt,b.exports=e},{"../core/core":55}],84:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.createVector=function(a,b,c){return this instanceof d?new d.Vector(this,arguments):new d.Vector(a,b,c)},b.exports=d},{"../core/core":55}],85:[function(a,b,c){"use strict";var d,e=a("../core/core"),f=4,g=1<<f,h=8,i=1<<h,j=4095,k=4,l=.5,m=function(a){return.5*(1-Math.cos(a*Math.PI))};e.prototype.noise=function(a,b,c){if(b=b||0,c=c||0,null==d){d=new Array(j+1);for(var e=0;e<j+1;e++)d[e]=Math.random()}a<0&&(a=-a),b<0&&(b=-b),c<0&&(c=-c);for(var n,o,p,q,r,s=Math.floor(a),t=Math.floor(b),u=Math.floor(c),v=a-s,w=b-t,x=c-u,y=0,z=.5,A=0;A<k;A++){var B=s+(t<<f)+(u<<h);n=m(v),o=m(w),p=d[B&j],p+=n*(d[B+1&j]-p),q=d[B+g&j],q+=n*(d[B+g+1&j]-q),p+=o*(q-p),B+=i,q=d[B&j],q+=n*(d[B+1&j]-q),r=d[B+g&j],r+=n*(d[B+g+1&j]-r),q+=o*(r-q),p+=m(x)*(q-p),y+=p*z,z*=l,s<<=1,v*=2,t<<=1,w*=2,u<<=1,x*=2,v>=1&&(s++,v--),w>=1&&(t++,w--),x>=1&&(u++,x--)}return y},e.prototype.noiseDetail=function(a,b){a>0&&(k=a),b>0&&(l=b)},e.prototype.noiseSeed=function(a){var b=function(){var a,b,c=4294967296,d=1664525,e=1013904223;return{setSeed:function(d){b=a=(null==d?Math.random()*c:d)>>>0},getSeed:function(){return a},rand:function(){return(b=(d*b+e)%c)/c}}}();b.setSeed(a),d=new Array(j+1);for(var c=0;c<j+1;c++)d[c]=b.rand()},b.exports=e},{"../core/core":55}],86:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("./polargeometry"),f=a("../core/constants");d.Vector=function(){var a,b,c;arguments[0]instanceof d?(this.p5=arguments[0],a=arguments[1][0]||0,b=arguments[1][1]||0,c=arguments[1][2]||0):(a=arguments[0]||0,b=arguments[1]||0,c=arguments[2]||0),this.x=a,this.y=b,this.z=c,this.name="p5.Vector"},d.Vector.prototype.toString=function(){return"p5.Vector Object : ["+this.x+", "+this.y+", "+this.z+"]"},d.Vector.prototype.set=function(a,b,c){return a instanceof d.Vector?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0,this):a instanceof Array?(this.x=a[0]||0,this.y=a[1]||0,this.z=a[2]||0,this):(this.x=a||0,this.y=b||0,this.z=c||0,this)},d.Vector.prototype.copy=function(){return this.p5?new d.Vector(this.p5,[this.x,this.y,this.z]):new d.Vector(this.x,this.y,this.z)},d.Vector.prototype.add=function(a,b,c){return a instanceof d.Vector?(this.x+=a.x||0,this.y+=a.y||0,this.z+=a.z||0,this):a instanceof Array?(this.x+=a[0]||0,this.y+=a[1]||0,this.z+=a[2]||0,this):(this.x+=a||0,this.y+=b||0,this.z+=c||°äŒf +return 1/this.font.unitsPerEm*(a||this.parent._renderer._textSize)},y.Font.prototype._handleAlignment=function(a,b,c,d,e,f){var g=a._renderer._textSize,h=this._textAscent(g),i=this._textDescent(g);return f=void 0!==f?f:this._textWidth(c,g),b.textAlign===z.CENTER?d-=f/2:b.textAlign===z.RIGHT&&(d-=f),b.textBaseline===z.TOP?e+=h:b.textBaseline===z._CTX_MIDDLE?e+=h/2:b.textBaseline===z.BOTTOM&&(e-=i),{x:d,y:e}},b.exports=y},{"../core/constants":54,"../core/core":55}],93:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.append=function(a,b){return a.push(b),a},d.prototype.arrayCopy=function(a,b,c,d,e){var f,g;void 0!==e?(g=Math.min(e,a.length),f=d,a=a.slice(b,g+b)):(void 0!==c?(g=c,g=Math.min(g,a.length)):g=a.length,f=0,c=b,a=a.slice(0,g)),Array.prototype.splice.apply(c,[f,g].concat(a))},d.prototype.concat=function(a,b){return a.concat(b)},d.prototype.reverse=function(a){return a.reverse()},d.prototype.shorten=function(a){return a.pop(),a},d.prototype.shuffle=function(a,b){var c=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(a);a=b||c?a:a.slice();for(var d,e,f=a.length;f>1;)d=Math.random()*f|0,e=a[--f],a[f]=a[d],a[d]=e;return a},d.prototype.sort=function(a,b){var c=b?a.slice(0,Math.min(b,a.length)):a,d=b?a.slice(Math.min(b,a.length)):[];return c="string"==typeof c[0]?c.sort():c.sort(function(a,b){return a-b}),c.concat(d)},d.prototype.splice=function(a,b,c){return Array.prototype.splice.apply(a,[c,0].concat(b)),a},d.prototype.subset=function(a,b,c){return void 0!==c?a.slice(b,b+c):a.slice(b,a.length)},b.exports=d},{"../core/core":55}],94:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.float=function(a){return a instanceof Array?a.map(parseFloat):parseFloat(a)},d.prototype.int=function(a,b){return b=b||10,"string"==typeof a?parseInt(a,b):"number"==typeof a?0|a:"boolean"==typeof a?a?1:0:a instanceof Array?a.map(function(a){return d.prototype.int(a,b)}):void 0},d.prototype.str=function(a){return a instanceof Array?a.map(d.prototype.str):String(a)},d.prototype.boolean=function(a){return"number"==typeof a?0!==a:"string"==typeof a?"true"===a.toLowerCase():"boolean"==typeof a?a:a instanceof Array?a.map(d.prototype.boolean):void 0},d.prototype.byte=function(a){var b=d.prototype.int(a,10);return"number"==typeof b?(b+128)%256-128:b instanceof Array?b.map(d.prototype.byte):void 0},d.prototype.char=function(a){return"number"!=typeof a||isNaN(a)?a instanceof Array?a.map(d.prototype.char):"string"==typeof a?d.prototype.char(parseInt(a,10)):void 0:String.fromCharCode(a)},d.prototype.unchar=function(a){return"string"==typeof a&&1===a.length?a.charCodeAt(0):a instanceof Array?a.map(d.prototype.unchar):void 0},d.prototype.hex=function(a,b){if(b=void 0===b||null===b?b=8:b,a instanceof Array)return a.map(function(a){return d.prototype.hex(a,b)});if("number"==typeof a){a<0&&(a=4294967295+a+1);for(var c=Number(a).toString(16).toUpperCase();c.length<b;)c="0"+c;return c.length>=b&&(c=c.substring(c.length-b,c.length)),c}},d.prototype.unhex=function(a){return a instanceof Array?a.map(d.prototype.unhex):parseInt("0x"+a,16)},b.exports=d},{"../core/core":55}],95:[function(a,b,c){"use strict";function d(){var a=arguments[0],b=a<0,c=b?a.toString().substring(1):a.toString(),d=c.indexOf("."),e=d!==-1?c.substring(0,d):c,f=d!==-1?c.substring(d+1):"",g=b?"-":"";if(3===arguments.length){var h="";(d!==-1||arguments[2]-f.length>0)&&(h="."),f.length>arguments[2]&&(f=f.substring(0,arguments[2]));for(var i=0;i<arguments[1]-e.length;i++)g+="0";g+=e,g+=h,g+=f;for(var j=0;j<arguments[2]-f.length;j++)g+="0";return g}for(var k=0;k<Math.max(arguments[1]-e.length,0);k++)g+="0";return g+=c}function e(){var a=arguments[0].toString(),b=a.indexOf("."),c=b!==-1?a.substring(b):"",d=b!==-1?a.substring(0,b):a;if(d=d.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),0===arguments[1])c="";else if(void 0!==arguments[1])if(arguments[1]>c.length){c+=b===-1?".":"";for(var e=arguments[1]-c.length+1,f=0;f<e;f++)c+="0"}else c=c.substring(0,arguments[1]+1);return d+c}function f(){return parseFloat(arguments[0])>0?"+"+arguments[0].toString():arguments[0].toString()}function g(){return parseFloat(arguments[0])>0?" "+arguments[0].toString():arguments[0].toString()}var h=a("../core/core");a("../core/error_helpers"),h.prototype.join=function(a,b){return h._validateParameters("join",arguments),a.join(b)},h.prototype.match=function(a,b){return h._validateParameters("match",arguments),a.match(b)},h.prototype.matchAll=function(a,b){h._validateParameters("matchAll",arguments);for(var c=new RegExp(b,"g"),d=c.exec(a),e=[];null!==d;)e.push(d),d=c.exec(a);return e},h.prototype.nf=function(){if(h._validateParameters("nf",arguments),arguments[0]instanceof Array){var a=arguments[1],b=arguments[2];return arguments[0].map(function(c){return d(c,a,b)})}return"[object Arguments]"===Object.prototype.toString.call(arguments[0])?3===arguments[0].length?this.nf(arguments[0][0],arguments[0][1],arguments[0][2]):2===arguments[0].length?this.nf(arguments[0][0],arguments[0][1]):this.nf(arguments[0][0]):d.apply(this,arguments)},h.prototype.nfc=function(){if(h._validateParameters("nfc",arguments),arguments[0]instanceof Array){var a=arguments[1];return arguments[0].map(function(b){return e(b,a)})}return e.apply(this,arguments)},h.prototype.nfp=function(){h._validateParameters("nfp",arguments);var a=h.prototype.nf.apply(this,arguments);return a instanceof Array?a.map(f):f(a)},h.prototype.nfs=function(){h._validateParameters("nfs",arguments);var a=h.prototype.nf.apply(this,arguments);return a instanceof Array?a.map(g):g(a)},h.prototype.split=function(a,b){return h._validateParameters("split",arguments),a.split(b)},h.prototype.splitTokens=function(){h._validateParameters("splitTokens",arguments);var a,b,c,d;return d=arguments[1],arguments.length>1?(c=/\]/g.exec(d),b=/\[/g.exec(d),b&&c?(d=d.slice(0,c.index)+d.slice(c.index+1),b=/\[/g.exec(d),d=d.slice(0,b.index)+d.slice(b.index+1),a=new RegExp("[\\["+d+"\\]]","g")):c?(d=d.slice(0,c.index)+d.slice(c.index+1),a=new RegExp("["+d+"\\]]","g")):b?(d=d.slice(0,b.index)+d.slice(b.index+1),a=new RegExp("["+d+"\\[]","g")):a=new RegExp("["+d+"]","g")):a=/\s/g,arguments[0].split(a).filter(function(a){return a})},h.prototype.trim=function(a){return h._validateParameters("trim",arguments),a instanceof Array?a.map(this.trim):a.trim()},b.exports=h},{"../core/core":55,"../core/error_helpers":58}],96:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.day=function(){return(new Date).getDate()},d.prototype.hour=function(){return(new Date).getHours()},d.prototype.minute=function(){return(new Date).getMinutes()},d.prototype.millis=function(){return window.performance.now()},d.prototype.month=function(){return(new Date).getMonth()+1},d.prototype.second=function(){return(new Date).getSeconds()},d.prototype.year=function(){return(new Date).getFullYear()},b.exports=d},{"../core/core":55}],97:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.camera=function(a,b,c){this._renderer.translate(-a,-b,-c)},d.prototype.perspective=function(a,b,c,e){a=a||60/180*this.PI,b=b||this.width/this.height,c=c||this.height/2/this.tan(a/2)*.1,e=e||this.height/2/this.tan(a/2)*10,this._renderer.uPMatrix=d.Matrix.identity(),this._renderer.uPMatrix.perspective(a,b,c,e),this._renderer._curCamera="custom"},d.prototype.ortho=function(a,b,c,e,f,g){a=a||-this.width/2,b=b||this.width/2,c=c||-this.height/2,e=e||this.height/2,f=f||0,g=g||Math.max(this.width,this.height),this._renderer.uPMatrix=d.Matrix.identity(),this._renderer.uPMatrix.ortho(a,b,c,e,f,g),this._renderer._curCamera="custom"},b.exports=d},{"../core/core":55}],98:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.orbitControl=function(){return this.mouseIsPressed&&(this.rotateY((this.mouseX-this.width/2)/(this.width/2)),this.rotateX((this.mouseY-this.height/2)/(this.width/2))),this},b.exports=d},{"../core/core":55}],99:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.ambientLight=function(a,b,c,d){var e=this._renderer.GL,f=this._renderer._getShader("lightVert","lightTextureFrag");e.useProgram(f),f.uAmbientColor=e.getUniformLocation(f,"uAmbientColor["+this._renderer.ambientLightCount+"]");var g=this._renderer._pInst.color.apply(this._renderer._pInst,arguments),h=g._array;return e.uniform3f(f.uAmbientColor,h[0],h[1],h[2]),f.uMaterialColor=e.getUniformLocation(f,"uMaterialColor"),e.uniform4f(f.uMaterialColor,1,1,1,1),this._renderer.ambientLightCount++,f.uAmbientLightCount=e.getUniformLocation(f,"uAmbientLightCount"),e.uniform1i(f.uAmbientLightCount,this._renderer.ambientLightCount),this},d.prototype.directionalLight=function(a,b,c,d,e,f,g){var h=this._renderer.GL,i=this._renderer._getShader("lightVert","lightTextureFrag");h.useProgram(i),i.uDirectionalColor=h.getUniformLocation(i,"uDirectionalColor["+this._renderer.directionalLightCount+"]");var j=this._renderer._pInst.color.apply(this._renderer._pInst,[a,b,c]),k=j._array;h.uniform3f(i.uDirectionalColor,k[0],k[1],k[2]);for(var l,m,n,o=new Array(arguments.length),p=0;p<o.length;++p)o[p]=arguments[p];if("number"==typeof o[o.length-1])l=o[o.length-3],m=o[o.length-2],n=o[o.length-1];else try{l=o[o.length-1].x,m=o[o.length-1].y,n=o[o.length-1].z}catch(a){throw a}return i.uLightingDirection=h.getUniformLocation(i,"uLightingDirection["+this._renderer.directionalLightCount+"]"),h.uniform3f(i.uLightingDirection,l,m,n),i.uMaterialColor=h.getUniformLocation(i,"uMaterialColor"),h.uniform4f(i.uMaterialColor,1,1,1,1),this._renderer.directionalLightCount++,i.uDirectionalLightCount=h.getUniformLocation(i,"uDirectionalLightCount"),h.uniform1i(i.uDirectionalLightCount,this._renderer.directionalLightCount),this},d.prototype.pointLight=function(a,b,c,d,e,f,g){var h=this._renderer.GL,i=this._renderer._getShader("lightVert","lightTextureFrag");h.useProgram(i),i.uPointLightColor=h.getUniformLocation(i,"uPointLightColor["+this._renderer.pointLightCount+"]");var j=this._renderer._pInst.color.apply(this._renderer._pInst,[a,b,c]),k=j._array;h.uniform3f(i.uPointLightColor,k[0],k[1],k[2]);for(var l,m,n,o=new Array(arguments.length),p=0;p<o.length;++p)o[p]=arguments[p];if("number"==typeof o[o.length-1])l=o[o.length-3],m=o[o.length-2],n=o[o.length-1];else try{l=o[o.length-1].x,m=o[o.length-1].y,n=o[o.length-1].z}catch(a){throw a}return i.uPointLightLocation=h.getUniformLocation(i,"uPointLightLocation["+this._renderer.pointLightCount+"]"),h.uniform3f(i.uPointLightLocation,l,m,n),i.uMaterialColor=h.getUniformLocation(i,"uMaterialColor"),h.uniform4f(i.uMaterialColor,1,1,1,1),this._renderer.pointLightCount++,i.uPointLightCount=h.getUniformLocation(i,"uPointLightCount"),h.uniform1i(i.uPointLightCount,this._renderer.pointLightCount),this},b.exports=d},{"../core/core":55}],100:[function(a,b,c){"use strict";function d(a,b){for(var c={v:[],vt:[],vn:[]},d={},f=0;f<b.length;++f){var g=b[f].trim().split(/\b\s+/);if(g.length>0)if("v"===g[0]||"vn"===g[0]){var h=new e.Vector(parseFloat(g[1]),parseFloat(g[2]),parseFloat(g[3]));c[g[0]].push(h)}else if("vt"===g[0]){var i=[parseFloat(g[1]),parseFloat(g[2])];c[g[0]].push(i)}else if("f"===g[0])for(var j=3;j<g.length;++j){for(var k=[],l=[1,j-1,j],m=0;m<l.length;++m){var n=g[l[m]],o=0;if(void 0!==d[n])o=d[n];else{for(var p=n.split("/"),q=0;q<p.length;q++)p[q]=parseInt(p[q])-1;o=d[n]=a.vertices.length,a.vertices.push(c.v[p[0]].copy()),c.vt[p[1]]?a.uvs.push(c.vt[p[1]].slice()):a.uvs.push([0,0]),c.vn[p[2]]&&a.vertexNormals.push(c.vn[p[2]].copy())}k.push(o)}a.faces.push(k)}}return 0===a.vertexNormals.length&&a.computeNormals(),a}var e=a("../core/core");a("./p5.Geometry"),e.prototype.loadModel=function(){var a,b,c,f=arguments[0];"boolean"==typeof arguments[1]?(a=arguments[1],b=arguments[2],c=arguments[3]):(a=!1,b=arguments[1],c=arguments[2]);var g=new e.Geometry;return g.gid=f+"|"+a,this.loadStrings(f,function(c){d(g,c),a&&g.normalize(),"function"==typeof b&&b(g)}.bind(this),c),g},e.prototype.model=function(a){a.vertices.length>0&&(this._renderer.geometryInHash(a.gid)||this._renderer.createBuffers(a.gid,a),this._renderer.drawBuffers(a.gid))},b.exports=e},{"../core/core":55,"./p5.Geometry":102}],101:[function(a,b,c){"use strict";var d=a("../core/core");d.prototype.normalMaterial=function(){return this._renderer._getShader("normalVert","normalFrag"),this},d.prototype.texture=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=this._renderer.GL;c.enable(c.BLEND),c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA),this._renderer.drawMode="texture";var e=this._renderer._getShader("lightVert","lightTextureFrag");c.useProgram(e);var f;if(a[0].isTexture)a[0]instanceof d.Graphics||void 0!==d.MediaElement&&a[0]instanceof d.MediaElement?f=a[0].elt:a[0]instanceof d.Image&&(f=a[0].canvas),this._renderer._bind.call(this,a[0].tex,f);else{if(a[0]instanceof d.Image)f=a[0].canvas;else if(void 0!==d.MediaElement&&a[0]instanceof d.MediaElement){if(!a[0].loadedmetadata)return;f=a[0].elt}else a[0]instanceof d.Graphics&&(f=a[0].elt);var g=c.createTexture();a[0]._setProperty("tex",g),a[0]._setProperty("isTexture",!0),this._renderer._bind.call(this,g,f)}return c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,a[0].tex),c.uniform1i(c.getUniformLocation(e,"isTexture"),!0),c.uniform1i(c.getUniformLocation(e,"uSampler"),0),this},d.RendererGL.prototype._bind=function(a,b){var c=this._renderer.GL;c.bindTexture(c.TEXTURE_2D,a),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,b),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!0),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.bindTexture(c.TEXTURE_2D,null)},d.prototype.ambientMaterial=function(a,b,c,d){var e=this._renderer.GL,f=this._renderer._getShader("lightVert","lightTextureFrag");e.useProgram(f),f.uMaterialColor=e.getUniformLocation(f,"uMaterialColor");var g=this._renderer._applyColorBlend.apply(this._renderer,arguments);return e.uniform4f(f.uMaterialColor,g[0],g[1],g[2],g[3]),f.uSpecular=e.getUniformLocation(f,"uSpecular"),e.uniform1i(f.uSpecular,!1),e.uniform1i(e.getUniformLocation(f,"isTexture"),!1),this},d.prototype.specularMaterial=function(a,b,c,d){var e=this._renderer.GL,f=this._renderer._getShader("lightVert","lightTextureFrag");e.useProgram(f),e.uniform1i(e.getUniformLocation(f,"isTexture"),!1),f.uMaterialColor=e.getUniformLocation(f,"uMate°äŒf +;d.RendererGL=function(a,b,c){return d.Renderer.call(this,a,b,c),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this.ambientLightCount=0,this.directionalLightCount=0,this.pointLightCount=0,this._curCamera=null,this.uMVMatrix=new d.Matrix,this.uPMatrix=new d.Matrix,this.uNMatrix=new d.Matrix("mat3"),this.gHash={},this.mHash={},this.isImmediateDrawing=!1,this.immediateMode={},this.curFillColor=[.5,.5,.5,1],this.curStrokeColor=[.5,.5,.5,1],this.pointSize=5,this.name="p5.RendererGL",this},d.RendererGL.prototype=Object.create(d.Renderer.prototype),d.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",g)||this.canvas.getContext("experimental-webgl",g),null===this.drawingContext)throw new Error("Error creating webgl context");console.log("p5.RendererGL: enabled webgl context");var a=this.drawingContext;a.enable(a.DEPTH_TEST),a.depthFunc(a.LEQUAL),a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight)}catch(a){throw new Error(a)}},d.RendererGL.prototype._setDefaultCamera=function(){if(null===this._curCamera){var a=this.width,b=this.height;this.uPMatrix=d.Matrix.identity();var c=this.height/2/Math.tan(30*Math.PI/180);this.uPMatrix.perspective(60/180*Math.PI,a/b,.1*c,10*c),this._curCamera="default"}},d.RendererGL.prototype._update=function(){this.uMVMatrix=d.Matrix.identity(),this.translate(0,0,-(this.height/2)/Math.tan(30*Math.PI/180)),this.ambientLightCount=0,this.directionalLightCount=0,this.pointLightCount=0},d.RendererGL.prototype.background=function(){var a=this.GL,b=this._pInst.color.apply(this._pInst,arguments),c=b.levels[0]/255,d=b.levels[1]/255,e=b.levels[2]/255,f=b.levels[3]/255;a.clearColor(c,d,e,f),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)},d.RendererGL.prototype._initShaders=function(a,b,c){var d=this.GL,f=d.createShader(d.VERTEX_SHADER);if(d.shaderSource(f,e[a]),d.compileShader(f),!d.getShaderParameter(f,d.COMPILE_STATUS))return alert("Yikes! An error occurred compiling the shaders:"+d.getShaderInfoLog(f)),null;var g=d.createShader(d.FRAGMENT_SHADER);if(d.shaderSource(g,e[b]),d.compileShader(g),!d.getShaderParameter(g,d.COMPILE_STATUS))return alert("Darn! An error occurred compiling the shaders:"+d.getShaderInfoLog(g)),null;var h=d.createProgram();return d.attachShader(h,f),d.attachShader(h,g),d.linkProgram(h),d.getProgramParameter(h,d.LINK_STATUS)||alert("Snap! Error linking shader program"),this._getLocation(h,c),h},d.RendererGL.prototype._getLocation=function(a,b){var c=this.GL;c.useProgram(a),a.uPMatrixUniform=c.getUniformLocation(a,"uProjectionMatrix"),a.uMVMatrixUniform=c.getUniformLocation(a,"uModelViewMatrix"),void 0===b&&(a.uNMatrixUniform=c.getUniformLocation(a,"uNormalMatrix"),a.samplerUniform=c.getUniformLocation(a,"uSampler"))},d.RendererGL.prototype._setUniform1f=function(a,b,c){var d=this.GL,e=this.mHash[a];return d.useProgram(e),e[b]=d.getUniformLocation(e,b),d.uniform1f(e[b],c),this},d.RendererGL.prototype._setMatrixUniforms=function(a){var b=this.GL,c=this.mHash[a];b.useProgram(c),b.uniformMatrix4fv(c.uPMatrixUniform,!1,this.uPMatrix.mat4),b.uniformMatrix4fv(c.uMVMatrixUniform,!1,this.uMVMatrix.mat4),this.uNMatrix.inverseTranspose(this.uMVMatrix),b.uniformMatrix3fv(c.uNMatrixUniform,!1,this.uNMatrix.mat3)},d.RendererGL.prototype._getShader=function(a,b,c){var d=a+"|"+b;if(!this.materialInHash(d)){var e=this._initShaders(a,b,c);this.mHash[d]=e}return this.curShaderId=d,this.mHash[this.curShaderId]},d.RendererGL.prototype._getCurShaderId=function(){if("fill"!==this.drawMode&&void 0===this.curShaderId){var a="normalVert|normalFrag",b=this._initShaders("normalVert","normalFrag");this.mHash[a]=b,this.curShaderId=a}else this.isImmediateDrawing&&"fill"===this.drawMode&&this._getShader("immediateVert","vertexColorFrag",!0);return this.curShaderId},d.RendererGL.prototype.fill=function(a,b,c,d){var e,f=this.GL,g=this._applyColorBlend.apply(this,arguments);return this.curFillColor=g,this.drawMode="fill",this.isImmediateDrawing?(e=this._getShader("immediateVert","vertexColorFrag"),f.useProgram(e)):(e=this._getShader("normalVert","basicFrag"),f.useProgram(e),e.uMaterialColor=f.getUniformLocation(e,"uMaterialColor"),f.uniform4f(e.uMaterialColor,g[0],g[1],g[2],g[3])),this},d.RendererGL.prototype.stroke=function(a,b,c,d){var e=this._pInst.color.apply(this._pInst,arguments),f=e._array;return this.curStrokeColor=f,this.drawMode="stroke",this},d.RendererGL.prototype._strokeCheck=function(){if("stroke"===this.drawMode)throw new Error("stroke for shapes in 3D not yet implemented, use fill for now :(")},d.RendererGL.prototype.strokeWeight=function(a){return this.pointSize=a,this},d.RendererGL.prototype.geometryInHash=function(a){return void 0!==this.gHash[a]},d.RendererGL.prototype.materialInHash=function(a){return void 0!==this.mHash[a]},d.RendererGL.prototype.resize=function(a,b){var c=this.GL;d.Renderer.prototype.resize.call(this,a,b),c.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),"default"===this._curCamera&&(this._curCamera=null,this._setDefaultCamera())},d.RendererGL.prototype.clear=function(){var a=this.GL;a.clearColor(arguments[0],arguments[1],arguments[2],arguments[3]),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)},d.RendererGL.prototype.translate=function(a,b,c){return this.uMVMatrix.translate([a,-b,c]),this},d.RendererGL.prototype.scale=function(a,b,c){return this.uMVMatrix.scale([a,b,c]),this},d.RendererGL.prototype.rotate=function(a,b){return this.uMVMatrix.rotate(a,b),this},d.RendererGL.prototype.rotateX=function(a){return this.rotate(a,[1,0,0]),this},d.RendererGL.prototype.rotateY=function(a){return this.rotate(a,[0,1,0]),this},d.RendererGL.prototype.rotateZ=function(a){return this.rotate(a,[0,0,1]),this},d.RendererGL.prototype.push=function(){f.push(this.uMVMatrix.copy())},d.RendererGL.prototype.pop=function(){if(0===f.length)throw new Error("Invalid popMatrix!");this.uMVMatrix=f.pop()},d.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=d.Matrix.identity(),this.translate(0,0,-800),this},d.RendererGL.prototype._applyTextProperties=function(){console.error("text commands not yet implemented in webgl")},b.exports=d.RendererGL},{"../core/core":55,"../core/p5.Renderer":62,"./p5.Matrix":103,"./shader":108}],107:[function(a,b,c){"use strict";var d=a("../core/core");a("./p5.Geometry"),d.prototype.plane=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,e=a[1]||c,f="number"==typeof a[2]?a[2]:1,g="number"==typeof a[3]?a[3]:1,h="plane|"+c+"|"+e+"|"+f+"|"+g;if(!this._renderer.geometryInHash(h)){var i=function(){for(var a,b,f,g=0;g<=this.detailY;g++){b=g/this.detailY;for(var h=0;h<=this.detailX;h++)a=h/this.detailX,f=new d.Vector(c*a-c/2,e*b-e/2,0),this.vertices.push(f),this.uvs.push([a,b])}},j=new d.Geometry(f,g,i);j.computeFaces().computeNormals(),this._renderer.createBuffers(h,j)}this._renderer.drawBuffers(h)},d.prototype.box=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,e=a[1]||c,f=a[2]||c,g="number"==typeof a[3]?a[3]:4,h="number"==typeof a[4]?a[4]:4,i="box|"+c+"|"+e+"|"+f+"|"+g+"|"+h;if(!this._renderer.geometryInHash(i)){var j=function(){for(var a=[[0,4,2,6],[1,3,5,7],[0,1,4,5],[2,6,3,7],[0,2,1,3],[4,5,6,7]],b=0,g=0;g<a.length;g++){for(var h=a[g],i=4*g,j=0;j<4;j++){var k=h[j],l=new d.Vector((2*(1&k)-1)*c/2,((2&k)-1)*e/2,((4&k)/2-1)*f/2);this.vertices.push(l),this.uvs.push([1&j,(2&j)/2]),b++}this.faces.push([i,i+1,i+2]),this.faces.push([i+2,i+1,i+3])}},k=new d.Geometry(g,h,j);k.computeNormals(),this._renderer.createBuffers(i,k)}return this._renderer.drawBuffers(i),this},d.prototype.sphere=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,e="number"==typeof a[1]?a[1]:24,f="number"==typeof a[2]?a[2]:16,g="sphere|"+c+"|"+e+"|"+f;if(!this._renderer.geometryInHash(g)){var h=function(){for(var a,b,e,f=0;f<=this.detailY;f++){b=f/this.detailY;for(var g=0;g<=this.detailX;g++){a=g/this.detailX;var h=2*Math.PI*a,i=Math.PI*b-Math.PI/2;e=new d.Vector(c*Math.cos(i)*Math.sin(h),c*Math.sin(i),c*Math.cos(i)*Math.cos(h)),this.vertices.push(e),this.uvs.push([a,b])}}},i=new d.Geometry(e,f,h);i.computeFaces().computeNormals().averageNormals().averagePoleNormals(),this._renderer.createBuffers(g,i)}return this._renderer.drawBuffers(g),this};var e=function(a,b,c,e,f,g,h){e=e<3?3:e,f=f<1?1:f,g=void 0===g||g,h=void 0===h||h;var i,j,k=(g?2:0)+(h?2:0),l=e+1,m=Math.atan2(a-b,c),n=g?-2:0,o=f+(h?2:0);for(i=n;i<=o;++i){var p,q=i/f,r=c*q;for(i<0?(r=0,q=1,p=a):i>f?(r=c,q=1,p=b):p=a+i/f*(b-a),i!==-2&&i!==f+2||(p=0,q=0),r-=c/2,j=0;j<l;++j)this.vertices.push(new d.Vector(Math.sin(j*Math.PI*2/e)*p,r,Math.cos(j*Math.PI*2/e)*p)),this.vertexNormals.push(new d.Vector(i<0||i>f?0:Math.sin(j*Math.PI*2/e)*Math.cos(m),i<0?-1:i>f?1:Math.sin(m),i<0||i>f?0:Math.cos(j*Math.PI*2/e)*Math.cos(m))),this.uvs.push([j/e,q])}for(i=0;i<f+k;++i)for(j=0;j<e;++j)this.faces.push([l*(i+0)+0+j,l*(i+0)+1+j,l*(i+1)+1+j]),this.faces.push([l*(i+0)+0+j,l*(i+1)+1+j,l*(i+1)+0+j])};d.prototype.cylinder=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,f=a[1]||c,g="number"==typeof a[2]?a[2]:24,h="number"==typeof a[3]?a[3]:16,i="cylinder|"+c+"|"+f+"|"+g+"|"+h;if(!this._renderer.geometryInHash(i)){var j=new d.Geometry(g,h);e.call(j,c,c,f,g,h,!0,!0),j.computeNormals(),this._renderer.createBuffers(i,j)}return this._renderer.drawBuffers(i),this},d.prototype.cone=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0]||50,f=a[1]||c,g="number"==typeof a[2]?a[2]:24,h="number"==typeof a[3]?a[3]:16,i="cone|"+c+"|"+f+"|"+g+"|"+h;if(!this._renderer.geometryInHash(i)){var j=new d.Geometry(g,h);e.call(j,c,0,f,g,h,!0,!0),j.computeNormals(),this._renderer.createBuffers(i,j)}return this._renderer.drawBuffers(i),this},d.prototype.ellipsoid=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c="number"==typeof a[3]?a[3]:24,e="number"==typeof a[4]?a[4]:24,f=a[0]||50,g=a[1]||f,h=a[2]||f,i="ellipsoid|"+f+"|"+g+"|"+h+"|"+c+"|"+e;if(!this._renderer.geometryInHash(i)){var j=function(){for(var a,b,c,e=0;e<=this.detailY;e++){b=e/this.detailY;for(var i=0;i<=this.detailX;i++){a=i/this.detailX;var j=2*Math.PI*a,k=Math.PI*b-Math.PI/2;c=new d.Vector(f*Math.cos(k)*Math.sin(j),g*Math.sin(k),h*Math.cos(k)*Math.cos(j)),this.vertices.push(c),this.uvs.push([a,b])}}},k=new d.Geometry(c,e,j);k.computeFaces().computeNormals(),this._renderer.createBuffers(i,k)}return this._renderer.drawBuffers(i),this},d.prototype.torus=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c="number"==typeof a[2]?a[2]:24,e="number"==typeof a[3]?a[3]:16,f=a[0]||50,g=a[1]||10,h="torus|"+f+"|"+g+"|"+c+"|"+e;if(!this._renderer.geometryInHash(h)){var i=function(){for(var a,b,c,e=0;e<=this.detailY;e++){b=e/this.detailY;for(var h=0;h<=this.detailX;h++){a=h/this.detailX;var i=2*Math.PI*a,j=2*Math.PI*b;c=new d.Vector((f+g*Math.cos(j))*Math.cos(i),(f+g*Math.cos(j))*Math.sin(i),g*Math.sin(j)),this.vertices.push(c),this.uvs.push([a,b])}}},j=new d.Geometry(c,e,i);j.computeFaces().computeNormals().averageNormals(),this._renderer.createBuffers(h,j)}return this._renderer.drawBuffers(h),this},d.RendererGL.prototype.point=function(a,b,c){return console.log("point not yet implemented in webgl"),this},d.RendererGL.prototype.triangle=function(a){var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],i="tri|"+b+"|"+c+"|"+e+"|"+f+"|"+g+"|"+h;if(!this.geometryInHash(i)){var j=function(){var a=[];a.push(new d.Vector(b,c,0)),a.push(new d.Vector(e,f,0)),a.push(new d.Vector(g,h,0)),this.vertices=a,this.faces=[[0,1,2]],this.uvs=[[0,0],[0,1],[1,1]]},k=new d.Geometry(1,1,j);k.computeNormals(),this.createBuffers(i,k)}return this.drawBuffers(i),this},d.RendererGL.prototype.ellipse=function(a){var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4]||24,h=a[5]||16,i="ellipse|"+a[0]+"|"+a[1]+"|"+a[2]+"|"+a[3];if(!this.geometryInHash(i)){var j=function(){for(var a,g,h,i=b+.5*e,j=c+.5*f,k=0;k<=this.detailY;k++){g=k/this.detailY;for(var l=0;l<=this.detailX;l++){a=l/this.detailX;var m=2*Math.PI*a;if(0===g)h=new d.Vector(i,j,0);else{var n=i+.5*e*Math.cos(m),o=j+.5*f*Math.sin(m);h=new d.Vector(n,o,0)}this.vertices.push(h),this.uvs.push([a,g])}}},k=new d.Geometry(g,h,j);k.computeFaces().computeNormals(),this.createBuffers(i,k)}return this.drawBuffers(i),this},d.RendererGL.prototype.rect=function(a){var b="rect|"+a[0]+"|"+a[1]+"|"+a[2]+"|"+a[3],c=a[0],e=a[1],f=a[2],g=a[3],h=a[4]||24,i=a[5]||16;if(!this.geometryInHash(b)){var j=function(){for(var a,b,h,i=0;i<=this.detailY;i++){b=i/this.detailY;for(var j=0;j<=this.detailX;j++)a=j/this.detailX,h=new d.Vector(c+f*a,e+g*b,0),this.vertices.push(h),this.uvs.push([a,b])}},k=new d.Geometry(h,i,j);k.computeFaces().computeNormals(),this.createBuffers(b,k)}return this.drawBuffers(b),this},d.RendererGL.prototype.quad=function(){for(var a=new Array(arguments.length),b=0;b<a.length;++b)a[b]=arguments[b];var c=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l="quad|"+c+"|"+e+"|"+f+"|"+g+"|"+h+"|"+i+"|"+j+"|"+k;if(!this.geometryInHash(l)){var m=function(){this.vertices.push(new d.Vector(c,e,0)),this.vertices.push(new d.Vector(f,g,0)),this.vertices.push(new d.Vector(h,i,0)),this.vertices.push(new d.Vector(j,k,0)),this.uvs.push([0,0],[1,0],[1,1],[0,1])},n=new d.Geometry(2,2,m);n.computeNormals(),n.faces=[[0,1,2],[2,3,0]],this.createBuffers(l,n)}return this.drawBuffers(l),this},d.RendererGL.prototype.bezier=function(a){var b=a[12]||20;this.beginShape();for(var c=[0,0,0,0],d=[0,0,0],e=0;e<=b;e++)c[0]=Math.pow(1-e/b,3),c[1]=e/b*3*Math.pow(1-e/b,2),c[2]=3*Math.pow(e/b,2)*(1-e/b),c[3]=Math.pow(e/b,3),d[0]=a[0]*c[0]+a[3]*c[1]+a[6]*c[2]+a[9]*c[3],d[1]=a[1]*c[0]+a[4]*c[1]+a[7]*c[2]+a[10]*c[3],d[2]=a[2]*c[0]+a[5]*c[1]+a[8]*c[2]+a[11]*c[3],this.vertex(d[0],d[1],d[2]);return this.endShape(),this},d.RendererGL.prototype.curve=function(a){var b=a[12];this.beginShape();for(var c=[0,0,0,0],d=[0,0,0],e=0;e<=b;e++)c[0]=.5*Math.pow(e/b,3),c[1]=.5*Math.pow(e/b,2),c[2]=e/b*.5,c[3]=.5,d[0]=c[0]*(-a[0]+3*a[3]-3*a[6]+a[9])+c[1]*(2*a[0]-5*a[3]+4*a[6]-a[9])+c[2]*(-a[0]+a[6])+c[3]*(2*a[3]),d[1]=c[0]*(-a[1]+3*a[4]-3*a[7]+a[10])+c[1]*(2*a[1]-5*a[4]+4*a[7]-a[10])+c[2]*(-a[1]+a[7])+c[3]*(2*a[4]),d[2]=c[0]*(-a[2]+3*a[5]-3*a[8]+a[11])+c[1]*(2*a[2]-5*a[5]+4*a[8]-a[11])+c[2]*(-a[2]+a[8])+c[3]*(2*a[5]),this.vertex(d[0],d[1],d[2]);return this.endShape(),this},d.RendererGL.prototype.line=function(a,b,c,d,e,f){return void 0===a&&void 0===b&&void 0===c&&void 0===d&&void 0===e&&void 0===f||(this.beginShape(),this.vertex(a,b,c),this.vertex(d,e,f),this.endShape()),this},b.exports=d},{"../core/core":55,"./p5.Geometry":102}],108:[function(a,b,c){b.exports={immediateVert:"attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nvarying vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition * vec3(1.0, -1.0, 1.0), 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n",vertexColorVert:"attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uM°äŒf |
