p5 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{src → dist}/accessibility/color_namer.js +48 -3
- package/{src → dist}/accessibility/describe.js +12 -2
- package/{src → dist}/accessibility/gridOutput.js +2 -2
- package/dist/accessibility/index.js +60 -0
- package/{src → dist}/accessibility/outputs.js +23 -2
- package/{src → dist}/accessibility/textOutput.js +2 -2
- package/dist/app.js +120 -0
- package/{src → dist}/color/color_conversion.js +48 -10
- package/{src → dist}/color/color_spaces/hsb.js +3 -1
- package/dist/color/creating_reading.js +3 -0
- package/dist/color/index.js +13 -0
- package/dist/color/p5.Color.culori.js +1 -0
- package/dist/color/p5.Color.js +3 -0
- package/{src → dist}/color/setting.js +9 -6
- package/{src/core/constants.js → dist/constants-tYr0tCl8.js} +284 -132
- package/{src → dist}/core/States.js +3 -1
- package/dist/core/constants.js +1 -0
- package/{src → dist}/core/environment.js +12 -10
- package/{src → dist}/core/friendly_errors/browser_errors.js +1 -1
- package/{src → dist}/core/friendly_errors/fes_core.js +14 -44
- package/{src → dist}/core/friendly_errors/file_errors.js +6 -3
- package/dist/core/friendly_errors/index.js +23 -0
- package/dist/core/friendly_errors/param_validator.js +5421 -0
- package/{src → dist}/core/friendly_errors/sketch_reader.js +50 -4
- package/{src → dist}/core/friendly_errors/sketch_verifier.js +6 -6
- package/{src → dist}/core/friendly_errors/stacktrace.js +3 -5
- package/{src → dist}/core/friendly_errors/validate_params.js +50 -41
- package/{src → dist}/core/helpers.js +9 -6
- package/dist/core/init.js +105 -0
- package/dist/core/internationalization.js +302 -0
- package/dist/core/legacy.js +73 -0
- package/dist/core/main.js +44 -0
- package/dist/core/noop.js +3 -0
- package/dist/core/p5.Graphics.js +40 -0
- package/dist/core/p5.Renderer.js +11 -0
- package/dist/core/p5.Renderer2D.js +44 -0
- package/dist/core/reference.js +1 -0
- package/dist/core/rendering.js +40 -0
- package/{src → dist}/core/structure.js +3 -3
- package/{src → dist}/core/transform.js +2 -2
- package/{src/color/creating_reading.js → dist/creating_reading-Cr8L2Jnm.js} +841 -13
- package/{src → dist}/data/index.js +3 -1
- package/{src → dist}/data/local_storage.js +2 -8
- package/{src → dist}/dom/dom.js +19 -13
- package/dist/dom/index.js +18 -0
- package/{src → dist}/dom/p5.Element.js +14 -12
- package/{src → dist}/dom/p5.File.js +4 -4
- package/{src → dist}/dom/p5.MediaElement.js +10 -4
- package/{src → dist}/events/acceleration.js +26 -26
- package/{src → dist}/events/index.js +3 -1
- package/{src → dist}/events/keyboard.js +14 -12
- package/{src → dist}/events/pointer.js +16 -17
- package/dist/image/const.js +9 -0
- package/{src → dist}/image/filterRenderer2D.js +57 -37
- package/{src → dist}/image/filters.js +1 -3
- package/dist/image/image.js +40 -0
- package/dist/image/index.js +51 -0
- package/dist/image/loading_displaying.js +40 -0
- package/dist/image/p5.Image.js +11 -0
- package/{src → dist}/image/pixels.js +5 -3
- package/{src → dist}/io/csv.js +72 -70
- package/dist/io/files.js +40 -0
- package/dist/io/index.js +51 -0
- package/{src → dist}/io/p5.Table.js +6 -6
- package/{src → dist}/io/p5.TableRow.js +5 -6
- package/{src → dist}/io/p5.XML.js +2 -5
- package/{src → dist}/io/utilities.js +1 -1
- package/{src/core/p5.Renderer2D.js → dist/main-CAxvgiOV.js} +738 -57
- package/{src → dist}/math/Matrices/Matrix.js +10 -8
- package/{src → dist}/math/Matrices/MatrixInterface.js +5 -3
- package/{src → dist}/math/Matrices/MatrixNumjs.js +12 -26
- package/{src → dist}/math/calculation.js +2 -2
- package/{src → dist}/math/index.js +6 -3
- package/{src → dist}/math/math.js +3 -3
- package/{src → dist}/math/noise.js +2 -2
- package/{src → dist}/math/p5.Matrix.js +7 -4
- package/{src → dist}/math/p5.Vector.js +6 -6
- package/{src → dist}/math/random.js +2 -2
- package/{src → dist}/math/trigonometry.js +16 -15
- package/{src/image/p5.Image.js → dist/p5.Renderer-Swjl9HQO.js} +393 -22
- package/dist/rendering-B5TRR7aY.js +24960 -0
- package/{src → dist}/shape/2d_primitives.js +18 -17
- package/{src → dist}/shape/attributes.js +18 -17
- package/{src → dist}/shape/curves.js +2 -2
- package/{src → dist}/shape/custom_shapes.js +44 -64
- package/{src → dist}/shape/index.js +10 -2
- package/{src → dist}/shape/vertex.js +2 -3
- package/dist/type/index.js +25 -0
- package/{src → dist}/type/lib/Typr.js +76 -94
- package/{src → dist}/type/p5.Font.js +37 -63
- package/{src → dist}/type/textCore.js +35 -58
- package/{src → dist}/type/unicodeRanges.js +3 -1
- package/{src → dist}/utilities/conversion.js +2 -2
- package/{src → dist}/utilities/index.js +3 -1
- package/{src → dist}/utilities/time_date.js +6 -7
- package/{src → dist}/utilities/utility_functions.js +2 -2
- package/dist/webgl/3d_primitives.js +40 -0
- package/{src → dist}/webgl/GeometryBufferCache.js +3 -1
- package/{src → dist}/webgl/GeometryBuilder.js +12 -8
- package/{src → dist}/webgl/ShaderGenerator.js +79 -82
- package/{src → dist}/webgl/ShapeBuilder.js +26 -23
- package/dist/webgl/index.js +76 -0
- package/{src → dist}/webgl/interaction.js +7 -6
- package/dist/webgl/light.js +40 -0
- package/{src → dist}/webgl/loading.js +45 -12
- package/dist/webgl/material.js +40 -0
- package/dist/webgl/p5.Camera.js +40 -0
- package/{src → dist}/webgl/p5.DataArray.js +3 -5
- package/dist/webgl/p5.Framebuffer.js +40 -0
- package/{src → dist}/webgl/p5.Geometry.js +12 -15
- package/{src → dist}/webgl/p5.Quat.js +5 -4
- package/{src → dist}/webgl/p5.RenderBuffer.js +2 -3
- package/dist/webgl/p5.RendererGL.js +40 -0
- package/dist/webgl/p5.Shader.js +40 -0
- package/dist/webgl/p5.Texture.js +40 -0
- package/{src → dist}/webgl/text.js +78 -38
- package/lib/p5.esm.js +296 -194
- package/lib/p5.js +296 -194
- package/lib/p5.min.js +1 -1
- package/package.json +17 -17
- package/translations/dev.js +6 -6
- package/translations/index.js +1 -1
- package/types/accessibility/color_namer.d.ts +8 -0
- package/types/accessibility/describe.d.ts +184 -0
- package/types/accessibility/gridOutput.d.ts +8 -0
- package/types/accessibility/outputs.d.ts +235 -0
- package/types/accessibility/textOutput.d.ts +8 -0
- package/types/color/color_conversion.d.ts +47 -0
- package/types/color/creating_reading.d.ts +1348 -0
- package/types/color/p5.Color.d.ts +1070 -0
- package/types/color/setting.d.ts +2085 -0
- package/types/core/constants.d.ts +341 -0
- package/types/core/environment.d.ts +668 -0
- package/types/core/friendly_errors/fes_core.d.ts +8 -0
- package/types/core/friendly_errors/file_errors.d.ts +8 -0
- package/types/core/friendly_errors/param_validator.d.ts +30 -0
- package/types/core/friendly_errors/sketch_reader.d.ts +8 -0
- package/types/core/friendly_errors/stacktrace.d.ts +11 -0
- package/types/core/friendly_errors/validate_params.d.ts +8 -0
- package/types/core/helpers.d.ts +8 -0
- package/types/core/legacy.d.ts +8 -0
- package/types/core/main.d.ts +5996 -0
- package/types/core/p5.Graphics.d.ts +484 -0
- package/types/core/p5.Renderer.d.ts +14 -0
- package/types/core/reference.d.ts +8 -0
- package/types/core/rendering.d.ts +481 -0
- package/types/core/structure.d.ts +492 -0
- package/types/core/transform.d.ts +1638 -0
- package/types/data/local_storage.d.ts +323 -0
- package/types/dom/dom.d.ts +1295 -0
- package/types/dom/p5.Element.d.ts +2011 -0
- package/types/dom/p5.File.d.ts +13 -0
- package/types/dom/p5.MediaElement.d.ts +1249 -0
- package/types/events/acceleration.d.ts +193 -0
- package/types/events/keyboard.d.ts +499 -0
- package/types/events/pointer.d.ts +782 -0
- package/types/global.d.ts +5542 -0
- package/types/image/filterRenderer2D.d.ts +54 -0
- package/types/image/image.d.ts +326 -0
- package/types/image/loading_displaying.d.ts +580 -0
- package/types/image/p5.Image.d.ts +5882 -0
- package/types/image/pixels.d.ts +832 -0
- package/types/io/files.d.ts +1447 -0
- package/types/io/p5.Table.d.ts +1247 -0
- package/types/io/p5.TableRow.d.ts +343 -0
- package/types/io/p5.XML.d.ts +1188 -0
- package/types/math/Matrices/Matrix.d.ts +1029 -0
- package/types/math/Matrices/MatrixNumjs.d.ts +8 -0
- package/types/math/calculation.d.ts +923 -0
- package/types/math/math.d.ts +90 -0
- package/types/math/noise.d.ts +311 -0
- package/types/math/p5.Matrix.d.ts +8 -0
- package/types/math/p5.Vector.d.ts +3416 -0
- package/types/math/random.d.ts +267 -0
- package/types/math/trigonometry.d.ts +663 -0
- package/types/p5.d.ts +6663 -0
- package/types/shape/2d_primitives.d.ts +1033 -0
- package/types/shape/attributes.d.ts +466 -0
- package/types/shape/curves.d.ts +740 -0
- package/types/shape/custom_shapes.d.ts +888 -0
- package/types/shape/vertex.d.ts +1141 -0
- package/types/type/p5.Font.d.ts +575 -0
- package/types/type/textCore.d.ts +1198 -0
- package/types/utilities/conversion.d.ts +894 -0
- package/types/utilities/time_date.d.ts +295 -0
- package/types/utilities/utility_functions.d.ts +587 -0
- package/types/webgl/3d_primitives.d.ts +1432 -0
- package/types/webgl/ShaderGenerator.d.ts +8 -0
- package/types/webgl/interaction.d.ts +371 -0
- package/types/webgl/light.d.ts +1184 -0
- package/types/webgl/loading.d.ts +481 -0
- package/types/webgl/material.d.ts +2656 -0
- package/types/webgl/p5.Camera.d.ts +3023 -0
- package/types/webgl/p5.DataArray.d.ts +61 -0
- package/types/webgl/p5.Framebuffer.d.ts +760 -0
- package/types/webgl/p5.Geometry.d.ts +1191 -0
- package/types/webgl/p5.Quat.d.ts +45 -0
- package/types/webgl/p5.RendererGL.d.ts +234 -0
- package/types/webgl/p5.Shader.d.ts +660 -0
- package/types/webgl/p5.Texture.d.ts +61 -0
- package/types/webgl/text.d.ts +74 -0
- package/src/README.md +0 -27
- package/src/accessibility/index.js +0 -13
- package/src/app.js +0 -61
- package/src/color/index.js +0 -9
- package/src/color/p5.Color.culori.js +0 -66
- package/src/color/p5.Color.js +0 -851
- package/src/core/README.md +0 -91
- package/src/core/friendly_errors/index.js +0 -13
- package/src/core/friendly_errors/param_validator.js +0 -561
- package/src/core/init.js +0 -58
- package/src/core/internationalization.js +0 -195
- package/src/core/legacy.js +0 -29
- package/src/core/main.js +0 -689
- package/src/core/noop.js +0 -1
- package/src/core/p5.Graphics.js +0 -696
- package/src/core/p5.Renderer.js +0 -408
- package/src/core/reference.js +0 -2060
- package/src/core/rendering.js +0 -697
- package/src/dom/index.js +0 -11
- package/src/image/const.js +0 -6
- package/src/image/image.js +0 -731
- package/src/image/index.js +0 -15
- package/src/image/loading_displaying.js +0 -1431
- package/src/io/files.js +0 -2210
- package/src/io/index.js +0 -11
- package/src/math/README.md +0 -40
- package/src/type/index.js +0 -9
- package/src/webgl/3d_primitives.js +0 -2741
- package/src/webgl/index.js +0 -37
- package/src/webgl/light.js +0 -1851
- package/src/webgl/material.js +0 -3854
- package/src/webgl/p5.Camera.js +0 -4010
- package/src/webgl/p5.Framebuffer.js +0 -1865
- package/src/webgl/p5.RendererGL.js +0 -2867
- package/src/webgl/p5.Shader.js +0 -1505
- package/src/webgl/p5.Texture.js +0 -541
- package/src/webgl/shaders/basic.frag +0 -6
- package/src/webgl/shaders/filters/base.frag +0 -22
- package/src/webgl/shaders/filters/base.vert +0 -19
- package/src/webgl/shaders/filters/blur.frag +0 -60
- package/src/webgl/shaders/filters/default.vert +0 -18
- package/src/webgl/shaders/filters/dilate.frag +0 -39
- package/src/webgl/shaders/filters/erode.frag +0 -39
- package/src/webgl/shaders/filters/gray.frag +0 -16
- package/src/webgl/shaders/filters/invert.frag +0 -15
- package/src/webgl/shaders/filters/opaque.frag +0 -12
- package/src/webgl/shaders/filters/posterize.frag +0 -29
- package/src/webgl/shaders/filters/threshold.frag +0 -23
- package/src/webgl/shaders/font.frag +0 -216
- package/src/webgl/shaders/font.vert +0 -44
- package/src/webgl/shaders/imageLight.vert +0 -33
- package/src/webgl/shaders/imageLightDiffused.frag +0 -82
- package/src/webgl/shaders/imageLightSpecular.frag +0 -134
- package/src/webgl/shaders/light.vert +0 -37
- package/src/webgl/shaders/light_texture.frag +0 -26
- package/src/webgl/shaders/lighting.glsl +0 -227
- package/src/webgl/shaders/line.frag +0 -74
- package/src/webgl/shaders/line.vert +0 -294
- package/src/webgl/shaders/normal.frag +0 -6
- package/src/webgl/shaders/normal.vert +0 -72
- package/src/webgl/shaders/phong.frag +0 -84
- package/src/webgl/shaders/phong.vert +0 -87
- package/src/webgl/shaders/point.frag +0 -29
- package/src/webgl/shaders/point.vert +0 -19
- package/src/webgl/shaders/sphereMapping.frag +0 -26
- package/src/webgl/shaders/webgl2Compatibility.glsl +0 -34
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// This file is auto-generated from JSDoc documentation
|
|
2
|
+
|
|
3
|
+
import p5 from 'p5';
|
|
4
|
+
|
|
5
|
+
declare module 'p5' {
|
|
6
|
+
/**
|
|
7
|
+
* Initializes common texture parameters, creates a gl texture,
|
|
8
|
+
* tries to upload the texture for the first time if data is
|
|
9
|
+
* already available.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
function init(data: any): void;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Checks if the source data for this texture has changed (if it's
|
|
16
|
+
* easy to do so) and reuploads the texture if necessary. If it's not
|
|
17
|
+
* possible or to expensive to do a calculation to determine wheter or
|
|
18
|
+
* not the data has occurred, this method simply re-uploads the texture.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
function update(): void;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Binds the texture to the appropriate GL target.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
function bindTexture(): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Unbinds the texture from the appropriate GL target.
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
function unbindTexture(): void;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Sets how a texture is be interpolated when upscaled or downscaled.
|
|
37
|
+
* Nearest filtering uses nearest neighbor scaling when interpolating
|
|
38
|
+
* Linear filtering uses WebGL's linear scaling when interpolating
|
|
39
|
+
*
|
|
40
|
+
* @param Specifies the texture filtering when
|
|
41
|
+
* textures are shrunk. Options are LINEAR or NEAREST
|
|
42
|
+
* @param Specifies the texture filtering when
|
|
43
|
+
* textures are magnified. Options are LINEAR or NEAREST
|
|
44
|
+
* @todo implement mipmapping filters
|
|
45
|
+
*/
|
|
46
|
+
function setInterpolation(downScale: string, upScale: string): void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Sets the texture wrapping mode. This controls how textures behave
|
|
50
|
+
* when their uv's go outside of the 0 - 1 range. There are three options:
|
|
51
|
+
* CLAMP, REPEAT, and MIRROR. REPEAT & MIRROR are only available if the texture
|
|
52
|
+
* is a power of two size (128, 256, 512, 1024, etc.).
|
|
53
|
+
*
|
|
54
|
+
* @param Controls the horizontal texture wrapping behavior
|
|
55
|
+
* @param Controls the vertical texture wrapping behavior
|
|
56
|
+
*/
|
|
57
|
+
function setWrapMode(wrapX: string, wrapY: string): void;
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default function p5_Texture(p5: any, fn: any): void;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// This file is auto-generated from JSDoc documentation
|
|
2
|
+
|
|
3
|
+
import p5 from 'p5';
|
|
4
|
+
|
|
5
|
+
declare module 'p5' {
|
|
6
|
+
/**
|
|
7
|
+
* @param the x positions of points in the curve
|
|
8
|
+
* @param the y positions of points in the curve
|
|
9
|
+
* @param the curve information
|
|
10
|
+
*
|
|
11
|
+
* adds a curve to the rows & columns that it intersects with
|
|
12
|
+
*/
|
|
13
|
+
function push(xs: number[], ys: number[], v: object): void;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param the value to scale
|
|
17
|
+
*
|
|
18
|
+
* converts a floating-point number in the range 0-1 to a byte 0-255
|
|
19
|
+
*/
|
|
20
|
+
function byte(v: number): void;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param writes the next pixel into an indexed ImageData
|
|
24
|
+
*/
|
|
25
|
+
function setPixel(imageInfo: object, r: number, g: number, b: number, a: number): void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @param the list of values to compare
|
|
29
|
+
* @param the initial minimum value
|
|
30
|
+
* @param the initial maximum value
|
|
31
|
+
*
|
|
32
|
+
* find the minimum & maximum value in a list of values
|
|
33
|
+
*/
|
|
34
|
+
function minMax(rg: number[], min: number, max: number): void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param the value to clamp
|
|
38
|
+
* @param the minimum value
|
|
39
|
+
* @param the maxmimum value
|
|
40
|
+
*
|
|
41
|
+
* clamps a value between a minimum & maximum value
|
|
42
|
+
*/
|
|
43
|
+
function clamp(v: number, min: number, max: number): void;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @returns an array of cubics whose quadratic approximations
|
|
47
|
+
* closely match the civen cubic.
|
|
48
|
+
*
|
|
49
|
+
* converts a cubic curve to a list of quadratics.
|
|
50
|
+
*/
|
|
51
|
+
function cubicToQuadratics(x0: number, y0: number, cx0: number, cy0: number, cx1: number, cy1: number, x1: number, y1: number): Cubic[];
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @param add a straight line to the row/col grid of a glyph
|
|
55
|
+
*/
|
|
56
|
+
function pushLine(x0: number, y0: number, x1: number, y1: number): void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @return true if the two points are sufficiently close
|
|
60
|
+
*
|
|
61
|
+
* tests if two points are close enough to be considered the same
|
|
62
|
+
*/
|
|
63
|
+
function samePoint(x0: number, y0: number, x1: number, y1: number): boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @return lays out the curves in a dimension (row or col) into two
|
|
67
|
+
* images, one for the indices of the curves themselves, and
|
|
68
|
+
* one containing the offset and length of those index spans.
|
|
69
|
+
*/
|
|
70
|
+
function layout(dimImageInfos: ImageInfo[], cellImageInfos: ImageInfo[]): object;
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default function text(p5: any, fn: any): void;
|
package/src/README.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Organization
|
|
2
|
-
|
|
3
|
-
The p5.js source code is organized into subdirectories which are roughly conceptually equivalent to third-party addons, except that these "addons" are actually just shipped as part of the p5.js library because the functionality they provide is so useful and central to p5's goal of building art projects for the web.
|
|
4
|
-
|
|
5
|
-
The `src/core` directory is the primary exception to this. It contains most of the internal logic of p5.js — the code which orchestrates everything else. It is possible to create optimized minimalist [custom builds](/contributor_docs/custom_p5_build.md) of the p5.js library which only include specific desired modules. In such a custom build, the contents of the core directory would be the only hard requirement, and everything else would be optional.
|
|
6
|
-
|
|
7
|
-
[JSDoc](https://jsdoc.app/) [module](https://jsdoc.app/tags-module.html) annotations are used throughout the codebase, but they primarily organize the public-facing [p5 reference manual](https://p5js.org/reference/), which is built automatically from the source code. These annotations structure the *expressive and creative API* of p5, and consequently they might not always align exactly with the *source code structure*.
|
|
8
|
-
|
|
9
|
-
The `app.js` file is simply an index of all the other modules which exports the p5 constructor function.
|
|
10
|
-
|
|
11
|
-
# APIs
|
|
12
|
-
|
|
13
|
-
p5.js seeks to create a toolkit for working with the web technologies that are most valuable for building art projects. For both expressive and pedagogical reasons, p5.js values (but does not necessarily always achieve lol!) clarity in its APIs. These are guidelines, and in practice there may be occasional exceptions.
|
|
14
|
-
|
|
15
|
-
## Public
|
|
16
|
-
|
|
17
|
-
Public APIs which are exposed to users of the p5.js library during the course of working on sketches and projects should use short, clear, declarative function names. `circle()` is preferable to `new Circle()`. If the name of a public API function is longer than one or two words, it may be worth carefully considering whether the API should be restructured into something more creative, expressive, or intuitive.
|
|
18
|
-
|
|
19
|
-
## Native
|
|
20
|
-
|
|
21
|
-
Native APIs provided by the browser can sometimes be aliased in the style of public APIs to provide a more creative, expressive, or intuitive interface than the native implementation. For example, `print()` is easier to explain than `console.log()`. Idiomatic JavaScript is generally preferable, so aliasing in this manner needs to have tremendous creative or pedagogical benefits.
|
|
22
|
-
|
|
23
|
-
Native browser functionality is also often aliased with properties on the `p5` object. This allows the library to consistently point toward the same reference, but in most cases this practice should not be considered part of the public API even though those properties are exposed to the user.
|
|
24
|
-
|
|
25
|
-
## Internal
|
|
26
|
-
|
|
27
|
-
Internal APIs which are not exposed to the user but are used for coordination within the library should generally take the form of constructor functions which can be exported across module boundaries. Those constructors are often attached to the `p5` constructor as a form of namespacing, but otherwise do not meaningfully act as methods that reference the host object. In cases where a `p5` object is needed inside a constructor, an instance will be explicitly passed as an input argument.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import describe from './describe.js';
|
|
2
|
-
import gridOutput from './gridOutput.js';
|
|
3
|
-
import textOutput from './textOutput.js';
|
|
4
|
-
import outputs from './outputs.js';
|
|
5
|
-
import colorNamer from './color_namer.js';
|
|
6
|
-
|
|
7
|
-
export default function(p5){
|
|
8
|
-
p5.registerAddon(describe);
|
|
9
|
-
p5.registerAddon(gridOutput);
|
|
10
|
-
p5.registerAddon(textOutput);
|
|
11
|
-
p5.registerAddon(outputs);
|
|
12
|
-
p5.registerAddon(colorNamer);
|
|
13
|
-
}
|
package/src/app.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// core
|
|
2
|
-
import p5 from './core/main';
|
|
3
|
-
|
|
4
|
-
// shape
|
|
5
|
-
import shape from './shape';
|
|
6
|
-
shape(p5);
|
|
7
|
-
|
|
8
|
-
//accessibility
|
|
9
|
-
import accessibility from './accessibility';
|
|
10
|
-
accessibility(p5);
|
|
11
|
-
|
|
12
|
-
// color
|
|
13
|
-
import color from './color';
|
|
14
|
-
color(p5);
|
|
15
|
-
|
|
16
|
-
// core
|
|
17
|
-
// currently, it only contains the test for parameter validation
|
|
18
|
-
import friendlyErrors from './core/friendly_errors';
|
|
19
|
-
friendlyErrors(p5);
|
|
20
|
-
|
|
21
|
-
// data
|
|
22
|
-
import data from './data';
|
|
23
|
-
data(p5);
|
|
24
|
-
|
|
25
|
-
// DOM
|
|
26
|
-
import dom from './dom';
|
|
27
|
-
dom(p5);
|
|
28
|
-
|
|
29
|
-
// events
|
|
30
|
-
import events from './events';
|
|
31
|
-
events(p5);
|
|
32
|
-
|
|
33
|
-
// image
|
|
34
|
-
import image from './image';
|
|
35
|
-
image(p5);
|
|
36
|
-
|
|
37
|
-
// io
|
|
38
|
-
import io from './io';
|
|
39
|
-
io(p5);
|
|
40
|
-
|
|
41
|
-
// math
|
|
42
|
-
import math from './math';
|
|
43
|
-
math(p5);
|
|
44
|
-
|
|
45
|
-
// utilities
|
|
46
|
-
import utilities from './utilities';
|
|
47
|
-
utilities(p5);
|
|
48
|
-
|
|
49
|
-
// webgl
|
|
50
|
-
import webgl from './webgl';
|
|
51
|
-
webgl(p5);
|
|
52
|
-
|
|
53
|
-
// typography
|
|
54
|
-
import type from './type'
|
|
55
|
-
type(p5);
|
|
56
|
-
|
|
57
|
-
import { waitForDocumentReady, waitingForTranslator, _globalInit } from './core/init';
|
|
58
|
-
Promise.all([waitForDocumentReady(), waitingForTranslator]).then(_globalInit);
|
|
59
|
-
|
|
60
|
-
export default p5;
|
|
61
|
-
|
package/src/color/index.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
class Color {
|
|
2
|
-
_color;
|
|
3
|
-
maxes;
|
|
4
|
-
mode;
|
|
5
|
-
array;
|
|
6
|
-
|
|
7
|
-
static addColorMode(mode, definition){
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
constructor(vals){
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
toString(){
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
setRed(new_red){
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
setGreen(new_green){
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
setBlue(new_blue){
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
setAlpha(new_alpha){
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
_getRed(){
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
_getGreen(){
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
_getBlue(){
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
_getAlpha(){
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
_getHue(){
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
_getSaturation(){
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
_getBrightness(){
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
_getLightness(){
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}
|