p5 2.0.1 → 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/dist/accessibility/color_namer.js +5 -5
- package/dist/accessibility/describe.js +10 -0
- package/dist/accessibility/index.js +5 -5
- package/dist/accessibility/outputs.js +21 -0
- package/dist/app.js +5 -5
- package/dist/color/color_conversion.js +5 -5
- package/dist/color/creating_reading.js +1 -1
- package/dist/color/index.js +2 -2
- package/dist/color/p5.Color.js +1 -1
- package/dist/color/setting.js +2 -2
- package/dist/{constants-C-g_eAdC.js → constants-tYr0tCl8.js} +19 -3
- package/dist/core/constants.js +1 -1
- package/dist/core/environment.js +6 -5
- package/dist/core/friendly_errors/fes_core.js +1 -1
- package/dist/core/friendly_errors/index.js +1 -1
- package/dist/core/friendly_errors/param_validator.js +41 -75
- package/dist/core/friendly_errors/sketch_reader.js +5 -5
- package/dist/core/friendly_errors/sketch_verifier.js +1 -1
- package/dist/core/friendly_errors/validate_params.js +5 -5
- package/dist/core/helpers.js +1 -1
- package/dist/core/init.js +5 -5
- package/dist/core/legacy.js +5 -5
- package/dist/core/main.js +5 -5
- package/dist/core/p5.Graphics.js +4 -4
- package/dist/core/p5.Renderer.js +3 -3
- package/dist/core/p5.Renderer2D.js +5 -5
- package/dist/core/rendering.js +4 -4
- package/dist/{creating_reading-D4AAKRbx.js → creating_reading-Cr8L2Jnm.js} +2 -2
- package/dist/dom/dom.js +10 -10
- package/dist/dom/index.js +2 -2
- package/dist/dom/p5.Element.js +2 -2
- package/dist/dom/p5.MediaElement.js +2 -2
- package/dist/events/acceleration.js +24 -24
- package/dist/events/keyboard.js +1 -2
- package/dist/image/const.js +1 -1
- package/dist/image/filterRenderer2D.js +4 -4
- package/dist/image/image.js +4 -4
- package/dist/image/index.js +4 -4
- package/dist/image/loading_displaying.js +4 -4
- package/dist/image/p5.Image.js +3 -3
- package/dist/image/pixels.js +1 -0
- package/dist/io/files.js +4 -4
- package/dist/io/index.js +4 -4
- package/dist/io/p5.TableRow.js +2 -2
- package/dist/{main-s72KWcUy.js → main-CAxvgiOV.js} +12 -9
- package/dist/math/Matrices/Matrix.js +1 -1
- package/dist/math/Matrices/MatrixNumjs.js +1 -1
- package/dist/math/index.js +1 -1
- package/dist/math/math.js +1 -1
- package/dist/math/p5.Matrix.js +1 -1
- package/dist/math/p5.Vector.js +1 -1
- package/dist/math/trigonometry.js +1 -1
- package/dist/{p5.Renderer-CwAYZOC2.js → p5.Renderer-Swjl9HQO.js} +5 -5
- package/dist/{rendering--aAe5aq3.js → rendering-B5TRR7aY.js} +101 -66
- package/dist/shape/2d_primitives.js +1 -1
- package/dist/shape/attributes.js +1 -1
- package/dist/shape/custom_shapes.js +2 -2
- package/dist/shape/index.js +2 -2
- package/dist/type/index.js +3 -3
- package/dist/type/p5.Font.js +3 -5
- package/dist/type/textCore.js +4 -4
- package/dist/webgl/3d_primitives.js +4 -4
- package/dist/webgl/GeometryBuilder.js +1 -1
- package/dist/webgl/ShapeBuilder.js +1 -1
- package/dist/webgl/index.js +4 -4
- package/dist/webgl/interaction.js +1 -1
- package/dist/webgl/light.js +4 -4
- package/dist/webgl/loading.js +4 -4
- package/dist/webgl/material.js +4 -4
- package/dist/webgl/p5.Camera.js +4 -4
- package/dist/webgl/p5.Framebuffer.js +4 -4
- package/dist/webgl/p5.Geometry.js +1 -1
- package/dist/webgl/p5.Quat.js +1 -1
- package/dist/webgl/p5.RendererGL.js +4 -4
- package/dist/webgl/p5.Shader.js +4 -4
- package/dist/webgl/p5.Texture.js +4 -4
- package/dist/webgl/text.js +32 -34
- package/lib/p5.esm.js +273 -225
- package/lib/p5.js +273 -225
- package/lib/p5.min.js +1 -1
- package/package.json +1 -2
- 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
|
@@ -0,0 +1,1348 @@
|
|
|
1
|
+
// This file is auto-generated from JSDoc documentation
|
|
2
|
+
|
|
3
|
+
import p5 from 'p5';
|
|
4
|
+
import { Color } from '../color/p5.Color';
|
|
5
|
+
|
|
6
|
+
declare module 'p5' {
|
|
7
|
+
type RGB = 'rgb';
|
|
8
|
+
|
|
9
|
+
type RGBHDR = 'rgbhdr';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* HSB (hue, saturation, brightness) is a type of color model.
|
|
13
|
+
You can learn more about it at
|
|
14
|
+
HSB.
|
|
15
|
+
*/
|
|
16
|
+
type HSB = 'hsb';
|
|
17
|
+
|
|
18
|
+
type HSL = 'hsl';
|
|
19
|
+
|
|
20
|
+
type HWB = 'hwb';
|
|
21
|
+
|
|
22
|
+
type LAB = 'lab';
|
|
23
|
+
|
|
24
|
+
type LCH = 'lch';
|
|
25
|
+
|
|
26
|
+
type OKLAB = 'oklab';
|
|
27
|
+
|
|
28
|
+
type OKLCH = 'oklch';
|
|
29
|
+
|
|
30
|
+
type RGBA = 'rgba';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Creates a p5.Color object.By default, the parameters are interpreted as RGB values. Calling
|
|
34
|
+
* `color(255, 204, 0)` will return a bright yellow color. The way these
|
|
35
|
+
* parameters are interpreted may be changed with the
|
|
36
|
+
* colorMode() function.The version of `color()` with one parameter interprets the value one of two
|
|
37
|
+
* ways. If the parameter is a number, it's interpreted as a grayscale value.
|
|
38
|
+
* If the parameter is a string, it's interpreted as a CSS color string.The version of `color()` with two parameters interprets the first one as a
|
|
39
|
+
* grayscale value. The second parameter sets the alpha (transparency) value.The version of `color()` with three parameters interprets them as RGB, HSB,
|
|
40
|
+
* or HSL colors, depending on the current `colorMode()`.The version of `color()` with four parameters interprets them as RGBA, HSBA,
|
|
41
|
+
* or HSLA colors, depending on the current `colorMode()`. The last parameter
|
|
42
|
+
* sets the alpha (transparency) value.
|
|
43
|
+
*
|
|
44
|
+
* @param number specifying value between white and black.
|
|
45
|
+
* @param alpha value relative to current color range
|
|
46
|
+
* (default is 0-255).
|
|
47
|
+
* @return resulting color.
|
|
48
|
+
* @example <div>
|
|
49
|
+
* <code>
|
|
50
|
+
* function setup() {
|
|
51
|
+
* createCanvas(100, 100);
|
|
52
|
+
*
|
|
53
|
+
* background(200);
|
|
54
|
+
*
|
|
55
|
+
* // Create a p5.Color object using RGB values.
|
|
56
|
+
* let c = color(255, 204, 0);
|
|
57
|
+
*
|
|
58
|
+
* // Draw the square.
|
|
59
|
+
* fill(c);
|
|
60
|
+
* noStroke();
|
|
61
|
+
* square(30, 20, 55);
|
|
62
|
+
*
|
|
63
|
+
* describe('A yellow square on a gray canvas.');
|
|
64
|
+
* }
|
|
65
|
+
* </code>
|
|
66
|
+
* </div>
|
|
67
|
+
* @example <div>
|
|
68
|
+
* <code>
|
|
69
|
+
* function setup() {
|
|
70
|
+
* createCanvas(100, 100);
|
|
71
|
+
*
|
|
72
|
+
* background(200);
|
|
73
|
+
*
|
|
74
|
+
* // Create a p5.Color object using RGB values.
|
|
75
|
+
* let c1 = color(255, 204, 0);
|
|
76
|
+
*
|
|
77
|
+
* // Draw the left circle.
|
|
78
|
+
* fill(c1);
|
|
79
|
+
* noStroke();
|
|
80
|
+
* circle(25, 25, 80);
|
|
81
|
+
*
|
|
82
|
+
* // Create a p5.Color object using a grayscale value.
|
|
83
|
+
* let c2 = color(65);
|
|
84
|
+
*
|
|
85
|
+
* // Draw the right circle.
|
|
86
|
+
* fill(c2);
|
|
87
|
+
* circle(75, 75, 80);
|
|
88
|
+
*
|
|
89
|
+
* describe(
|
|
90
|
+
* 'Two circles on a gray canvas. The circle in the top-left corner is yellow and the one at the bottom-right is gray.'
|
|
91
|
+
* );
|
|
92
|
+
* }
|
|
93
|
+
* </code>
|
|
94
|
+
* </div>
|
|
95
|
+
* @example <div>
|
|
96
|
+
* <code>
|
|
97
|
+
* function setup() {
|
|
98
|
+
* createCanvas(100, 100);
|
|
99
|
+
*
|
|
100
|
+
* background(200);
|
|
101
|
+
*
|
|
102
|
+
* // Create a p5.Color object using a named color.
|
|
103
|
+
* let c = color('magenta');
|
|
104
|
+
*
|
|
105
|
+
* // Draw the square.
|
|
106
|
+
* fill(c);
|
|
107
|
+
* noStroke();
|
|
108
|
+
* square(20, 20, 60);
|
|
109
|
+
*
|
|
110
|
+
* describe('A magenta square on a gray canvas.');
|
|
111
|
+
* }
|
|
112
|
+
* </code>
|
|
113
|
+
* </div>
|
|
114
|
+
* @example <div>
|
|
115
|
+
* <code>
|
|
116
|
+
* function setup() {
|
|
117
|
+
* createCanvas(100, 100);
|
|
118
|
+
*
|
|
119
|
+
* background(200);
|
|
120
|
+
*
|
|
121
|
+
* // Create a p5.Color object using a hex color code.
|
|
122
|
+
* let c1 = color('#0f0');
|
|
123
|
+
*
|
|
124
|
+
* // Draw the left rectangle.
|
|
125
|
+
* fill(c1);
|
|
126
|
+
* noStroke();
|
|
127
|
+
* rect(0, 10, 45, 80);
|
|
128
|
+
*
|
|
129
|
+
* // Create a p5.Color object using a hex color code.
|
|
130
|
+
* let c2 = color('#00ff00');
|
|
131
|
+
*
|
|
132
|
+
* // Draw the right rectangle.
|
|
133
|
+
* fill(c2);
|
|
134
|
+
* rect(55, 10, 45, 80);
|
|
135
|
+
*
|
|
136
|
+
* describe('Two bright green rectangles on a gray canvas.');
|
|
137
|
+
* }
|
|
138
|
+
* </code>
|
|
139
|
+
* </div>
|
|
140
|
+
* @example <div>
|
|
141
|
+
* <code>
|
|
142
|
+
* function setup() {
|
|
143
|
+
* createCanvas(100, 100);
|
|
144
|
+
*
|
|
145
|
+
* background(200);
|
|
146
|
+
*
|
|
147
|
+
* // Create a p5.Color object using a RGB color string.
|
|
148
|
+
* let c1 = color('rgb(0, 0, 255)');
|
|
149
|
+
*
|
|
150
|
+
* // Draw the top-left square.
|
|
151
|
+
* fill(c1);
|
|
152
|
+
* square(10, 10, 35);
|
|
153
|
+
*
|
|
154
|
+
* // Create a p5.Color object using a RGB color string.
|
|
155
|
+
* let c2 = color('rgb(0%, 0%, 100%)');
|
|
156
|
+
*
|
|
157
|
+
* // Draw the top-right square.
|
|
158
|
+
* fill(c2);
|
|
159
|
+
* square(55, 10, 35);
|
|
160
|
+
*
|
|
161
|
+
* // Create a p5.Color object using a RGBA color string.
|
|
162
|
+
* let c3 = color('rgba(0, 0, 255, 1)');
|
|
163
|
+
*
|
|
164
|
+
* // Draw the bottom-left square.
|
|
165
|
+
* fill(c3);
|
|
166
|
+
* square(10, 55, 35);
|
|
167
|
+
*
|
|
168
|
+
* // Create a p5.Color object using a RGBA color string.
|
|
169
|
+
* let c4 = color('rgba(0%, 0%, 100%, 1)');
|
|
170
|
+
*
|
|
171
|
+
* // Draw the bottom-right square.
|
|
172
|
+
* fill(c4);
|
|
173
|
+
* square(55, 55, 35);
|
|
174
|
+
*
|
|
175
|
+
* describe('Four blue squares in the corners of a gray canvas.');
|
|
176
|
+
* }
|
|
177
|
+
* </code>
|
|
178
|
+
* </div>
|
|
179
|
+
* @example <div>
|
|
180
|
+
* <code>
|
|
181
|
+
* function setup() {
|
|
182
|
+
* createCanvas(100, 100);
|
|
183
|
+
*
|
|
184
|
+
* background(200);
|
|
185
|
+
*
|
|
186
|
+
* // Create a p5.Color object using a HSL color string.
|
|
187
|
+
* let c1 = color('hsl(160, 100%, 50%)');
|
|
188
|
+
*
|
|
189
|
+
* // Draw the left rectangle.
|
|
190
|
+
* noStroke();
|
|
191
|
+
* fill(c1);
|
|
192
|
+
* rect(0, 10, 45, 80);
|
|
193
|
+
*
|
|
194
|
+
* // Create a p5.Color object using a HSLA color string.
|
|
195
|
+
* let c2 = color('hsla(160, 100%, 50%, 0.5)');
|
|
196
|
+
*
|
|
197
|
+
* // Draw the right rectangle.
|
|
198
|
+
* fill(c2);
|
|
199
|
+
* rect(55, 10, 45, 80);
|
|
200
|
+
*
|
|
201
|
+
* describe('Two sea green rectangles. A darker rectangle on the left and a brighter one on the right.');
|
|
202
|
+
* }
|
|
203
|
+
* </code>
|
|
204
|
+
* </div>
|
|
205
|
+
*
|
|
206
|
+
* <div>
|
|
207
|
+
* <code>
|
|
208
|
+
* function setup() {
|
|
209
|
+
* createCanvas(100, 100);
|
|
210
|
+
*
|
|
211
|
+
* background(200);
|
|
212
|
+
*
|
|
213
|
+
* // Create a p5.Color object using a HSB color string.
|
|
214
|
+
* let c1 = color('hsb(160, 100%, 50%)');
|
|
215
|
+
*
|
|
216
|
+
* // Draw the left rectangle.
|
|
217
|
+
* noStroke();
|
|
218
|
+
* fill(c1);
|
|
219
|
+
* rect(0, 10, 45, 80);
|
|
220
|
+
*
|
|
221
|
+
* // Create a p5.Color object using a HSBA color string.
|
|
222
|
+
* let c2 = color('hsba(160, 100%, 50%, 0.5)');
|
|
223
|
+
*
|
|
224
|
+
* // Draw the right rectangle.
|
|
225
|
+
* fill(c2);
|
|
226
|
+
* rect(55, 10, 45, 80);
|
|
227
|
+
*
|
|
228
|
+
* describe('Two green rectangles. A darker rectangle on the left and a brighter one on the right.');
|
|
229
|
+
* }
|
|
230
|
+
* </code>
|
|
231
|
+
* </div>
|
|
232
|
+
*
|
|
233
|
+
* <div>
|
|
234
|
+
* <code>
|
|
235
|
+
* function setup() {
|
|
236
|
+
* createCanvas(100, 100);
|
|
237
|
+
*
|
|
238
|
+
* background(200);
|
|
239
|
+
*
|
|
240
|
+
* // Create a p5.Color object using RGB values.
|
|
241
|
+
* let c1 = color(50, 55, 100);
|
|
242
|
+
*
|
|
243
|
+
* // Draw the left rectangle.
|
|
244
|
+
* fill(c1);
|
|
245
|
+
* rect(0, 10, 45, 80);
|
|
246
|
+
*
|
|
247
|
+
* // Switch the color mode to HSB.
|
|
248
|
+
* colorMode(HSB, 100);
|
|
249
|
+
*
|
|
250
|
+
* // Create a p5.Color object using HSB values.
|
|
251
|
+
* let c2 = color(50, 55, 100);
|
|
252
|
+
*
|
|
253
|
+
* // Draw the right rectangle.
|
|
254
|
+
* fill(c2);
|
|
255
|
+
* rect(55, 10, 45, 80);
|
|
256
|
+
*
|
|
257
|
+
* describe('Two blue rectangles. A darker rectangle on the left and a brighter one on the right.');
|
|
258
|
+
* }
|
|
259
|
+
* </code>
|
|
260
|
+
* </div>
|
|
261
|
+
*/
|
|
262
|
+
function color(gray: number, alpha?: number): p5.Color;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @param red or hue value relative to
|
|
266
|
+
* the current color range.
|
|
267
|
+
* @param green or saturation value
|
|
268
|
+
* relative to the current color range.
|
|
269
|
+
* @param blue or brightness value
|
|
270
|
+
* relative to the current color range.
|
|
271
|
+
*/
|
|
272
|
+
function color(v1: number, v2: number, v3: number, alpha?: number): p5.Color;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @param a color string.
|
|
276
|
+
*/
|
|
277
|
+
function color(value: string): p5.Color;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @param an array containing the red, green, blue,
|
|
281
|
+
* and alpha components of the color.
|
|
282
|
+
*/
|
|
283
|
+
function color(values: number[]): p5.Color;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
*/
|
|
287
|
+
function color(color: p5.Color): p5.Color;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Gets the red value of a color.`red()` extracts the red value from a
|
|
291
|
+
* p5.Color object, an array of color components, or
|
|
292
|
+
* a CSS color string.By default, `red()` returns a color's red value in the range 0
|
|
293
|
+
* to 255. If the colorMode() is set to RGB, it
|
|
294
|
+
* returns the red value in the given range.
|
|
295
|
+
*
|
|
296
|
+
* @param <a href="/reference/p5/p5.Color/">p5.Color</a> object, array of
|
|
297
|
+
* color components, or CSS color string.
|
|
298
|
+
* @return the red value.
|
|
299
|
+
* @example <div>
|
|
300
|
+
* <code>
|
|
301
|
+
* function setup() {
|
|
302
|
+
* createCanvas(100, 100);
|
|
303
|
+
*
|
|
304
|
+
* background(200);
|
|
305
|
+
*
|
|
306
|
+
* // Create a p5.Color object.
|
|
307
|
+
* let c = color(175, 100, 220);
|
|
308
|
+
*
|
|
309
|
+
* // Draw the left rectangle.
|
|
310
|
+
* noStroke();
|
|
311
|
+
* fill(c);
|
|
312
|
+
* rect(15, 15, 35, 70);
|
|
313
|
+
*
|
|
314
|
+
* // Set 'redValue' to 175.
|
|
315
|
+
* let redValue = red(c);
|
|
316
|
+
*
|
|
317
|
+
* // Draw the right rectangle.
|
|
318
|
+
* fill(redValue, 0, 0);
|
|
319
|
+
* rect(50, 15, 35, 70);
|
|
320
|
+
*
|
|
321
|
+
* describe('Two rectangles. The left one is light purple and the right one is red.');
|
|
322
|
+
* }
|
|
323
|
+
* </code>
|
|
324
|
+
* </div>
|
|
325
|
+
* @example <div>
|
|
326
|
+
* <code>
|
|
327
|
+
* function setup() {
|
|
328
|
+
* createCanvas(100, 100);
|
|
329
|
+
*
|
|
330
|
+
* background(200);
|
|
331
|
+
*
|
|
332
|
+
* // Create a color array.
|
|
333
|
+
* let c = [175, 100, 220];
|
|
334
|
+
*
|
|
335
|
+
* // Draw the left rectangle.
|
|
336
|
+
* noStroke();
|
|
337
|
+
* fill(c);
|
|
338
|
+
* rect(15, 15, 35, 70);
|
|
339
|
+
*
|
|
340
|
+
* // Set 'redValue' to 175.
|
|
341
|
+
* let redValue = red(c);
|
|
342
|
+
*
|
|
343
|
+
* // Draw the right rectangle.
|
|
344
|
+
* fill(redValue, 0, 0);
|
|
345
|
+
* rect(50, 15, 35, 70);
|
|
346
|
+
*
|
|
347
|
+
* describe('Two rectangles. The left one is light purple and the right one is red.');
|
|
348
|
+
* }
|
|
349
|
+
* </code>
|
|
350
|
+
* </div>
|
|
351
|
+
* @example <div>
|
|
352
|
+
* <code>
|
|
353
|
+
* function setup() {
|
|
354
|
+
* createCanvas(100, 100);
|
|
355
|
+
*
|
|
356
|
+
* background(200);
|
|
357
|
+
*
|
|
358
|
+
* // Create a CSS color string.
|
|
359
|
+
* let c = 'rgb(175, 100, 220)';
|
|
360
|
+
*
|
|
361
|
+
* // Draw the left rectangle.
|
|
362
|
+
* noStroke();
|
|
363
|
+
* fill(c);
|
|
364
|
+
* rect(15, 15, 35, 70);
|
|
365
|
+
*
|
|
366
|
+
* // Set 'redValue' to 175.
|
|
367
|
+
* let redValue = red(c);
|
|
368
|
+
*
|
|
369
|
+
* // Draw the right rectangle.
|
|
370
|
+
* fill(redValue, 0, 0);
|
|
371
|
+
* rect(50, 15, 35, 70);
|
|
372
|
+
*
|
|
373
|
+
* describe('Two rectangles. The left one is light purple and the right one is red.');
|
|
374
|
+
* }
|
|
375
|
+
* </code>
|
|
376
|
+
* </div>
|
|
377
|
+
* @example <div>
|
|
378
|
+
* <code>
|
|
379
|
+
* function setup() {
|
|
380
|
+
* createCanvas(100, 100);
|
|
381
|
+
*
|
|
382
|
+
* background(200);
|
|
383
|
+
*
|
|
384
|
+
* // Use RGB color with values in the range 0-100.
|
|
385
|
+
* colorMode(RGB, 100);
|
|
386
|
+
*
|
|
387
|
+
* // Create a p5.Color object.
|
|
388
|
+
* let c = color(69, 39, 86);
|
|
389
|
+
*
|
|
390
|
+
* // Draw the left rectangle.
|
|
391
|
+
* noStroke();
|
|
392
|
+
* fill(c);
|
|
393
|
+
* rect(15, 15, 35, 70);
|
|
394
|
+
*
|
|
395
|
+
* // Set 'redValue' to 69.
|
|
396
|
+
* let redValue = red(c);
|
|
397
|
+
*
|
|
398
|
+
* // Draw the right rectangle.
|
|
399
|
+
* fill(redValue, 0, 0);
|
|
400
|
+
* rect(50, 15, 35, 70);
|
|
401
|
+
*
|
|
402
|
+
* describe('Two rectangles. The left one is light purple and the right one is red.');
|
|
403
|
+
* }
|
|
404
|
+
* </code>
|
|
405
|
+
* </div>
|
|
406
|
+
*/
|
|
407
|
+
function red(color: p5.Color | number[] | string): number;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Gets the green value of a color.`green()` extracts the green value from a
|
|
411
|
+
* p5.Color object, an array of color components, or
|
|
412
|
+
* a CSS color string.By default, `green()` returns a color's green value in the range 0
|
|
413
|
+
* to 255. If the colorMode() is set to RGB, it
|
|
414
|
+
* returns the green value in the given range.
|
|
415
|
+
*
|
|
416
|
+
* @param <a href="/reference/p5/p5.Color/">p5.Color</a> object, array of
|
|
417
|
+
* color components, or CSS color string.
|
|
418
|
+
* @return the green value.
|
|
419
|
+
* @example <div>
|
|
420
|
+
* <code>
|
|
421
|
+
* function setup() {
|
|
422
|
+
* createCanvas(100, 100);
|
|
423
|
+
*
|
|
424
|
+
* background(200);
|
|
425
|
+
*
|
|
426
|
+
* // Create a p5.Color object.
|
|
427
|
+
* let c = color(175, 100, 220);
|
|
428
|
+
*
|
|
429
|
+
* // Draw the left rectangle.
|
|
430
|
+
* noStroke();
|
|
431
|
+
* fill(c);
|
|
432
|
+
* rect(15, 15, 35, 70);
|
|
433
|
+
*
|
|
434
|
+
* // Set 'greenValue' to 100.
|
|
435
|
+
* let greenValue = green(c);
|
|
436
|
+
*
|
|
437
|
+
* // Draw the right rectangle.
|
|
438
|
+
* fill(0, greenValue, 0);
|
|
439
|
+
* rect(50, 15, 35, 70);
|
|
440
|
+
*
|
|
441
|
+
* describe('Two rectangles. The left one is light purple and the right one is dark green.');
|
|
442
|
+
* }
|
|
443
|
+
* </code>
|
|
444
|
+
* </div>
|
|
445
|
+
* @example <div>
|
|
446
|
+
* <code>
|
|
447
|
+
* function setup() {
|
|
448
|
+
* createCanvas(100, 100);
|
|
449
|
+
*
|
|
450
|
+
* background(200);
|
|
451
|
+
*
|
|
452
|
+
* // Create a color array.
|
|
453
|
+
* let c = [175, 100, 220];
|
|
454
|
+
*
|
|
455
|
+
* // Draw the left rectangle.
|
|
456
|
+
* noStroke();
|
|
457
|
+
* fill(c);
|
|
458
|
+
* rect(15, 15, 35, 70);
|
|
459
|
+
*
|
|
460
|
+
* // Set 'greenValue' to 100.
|
|
461
|
+
* let greenValue = green(c);
|
|
462
|
+
*
|
|
463
|
+
* // Draw the right rectangle.
|
|
464
|
+
* fill(0, greenValue, 0);
|
|
465
|
+
* rect(50, 15, 35, 70);
|
|
466
|
+
*
|
|
467
|
+
* describe('Two rectangles. The left one is light purple and the right one is dark green.');
|
|
468
|
+
* }
|
|
469
|
+
* </code>
|
|
470
|
+
* </div>
|
|
471
|
+
* @example <div>
|
|
472
|
+
* <code>
|
|
473
|
+
* function setup() {
|
|
474
|
+
* createCanvas(100, 100);
|
|
475
|
+
*
|
|
476
|
+
* background(200);
|
|
477
|
+
*
|
|
478
|
+
* // Create a CSS color string.
|
|
479
|
+
* let c = 'rgb(175, 100, 220)';
|
|
480
|
+
*
|
|
481
|
+
* // Draw the left rectangle.
|
|
482
|
+
* noStroke();
|
|
483
|
+
* fill(c);
|
|
484
|
+
* rect(15, 15, 35, 70);
|
|
485
|
+
*
|
|
486
|
+
* // Set 'greenValue' to 100.
|
|
487
|
+
* let greenValue = green(c);
|
|
488
|
+
*
|
|
489
|
+
* // Draw the right rectangle.
|
|
490
|
+
* fill(0, greenValue, 0);
|
|
491
|
+
* rect(50, 15, 35, 70);
|
|
492
|
+
*
|
|
493
|
+
* describe('Two rectangles. The left one is light purple and the right one is dark green.');
|
|
494
|
+
* }
|
|
495
|
+
* </code>
|
|
496
|
+
* </div>
|
|
497
|
+
* @example <div>
|
|
498
|
+
* <code>
|
|
499
|
+
* function setup() {
|
|
500
|
+
* createCanvas(100, 100);
|
|
501
|
+
*
|
|
502
|
+
* background(200);
|
|
503
|
+
*
|
|
504
|
+
* // Use RGB color with values in the range 0-100.
|
|
505
|
+
* colorMode(RGB, 100);
|
|
506
|
+
*
|
|
507
|
+
* // Create a p5.Color object using RGB values.
|
|
508
|
+
* let c = color(69, 39, 86);
|
|
509
|
+
*
|
|
510
|
+
* // Draw the left rectangle.
|
|
511
|
+
* noStroke();
|
|
512
|
+
* fill(c);
|
|
513
|
+
* rect(15, 15, 35, 70);
|
|
514
|
+
*
|
|
515
|
+
* // Set 'greenValue' to 39.
|
|
516
|
+
* let greenValue = green(c);
|
|
517
|
+
*
|
|
518
|
+
* // Draw the right rectangle.
|
|
519
|
+
* fill(0, greenValue, 0);
|
|
520
|
+
* rect(50, 15, 35, 70);
|
|
521
|
+
*
|
|
522
|
+
* describe('Two rectangles. The left one is light purple and the right one is dark green.');
|
|
523
|
+
* }
|
|
524
|
+
* </code>
|
|
525
|
+
* </div>
|
|
526
|
+
*/
|
|
527
|
+
function green(color: p5.Color | number[] | string): number;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Gets the blue value of a color.`blue()` extracts the blue value from a
|
|
531
|
+
* p5.Color object, an array of color components, or
|
|
532
|
+
* a CSS color string.By default, `blue()` returns a color's blue value in the range 0
|
|
533
|
+
* to 255. If the colorMode() is set to RGB, it
|
|
534
|
+
* returns the blue value in the given range.
|
|
535
|
+
*
|
|
536
|
+
* @param <a href="/reference/p5/p5.Color/">p5.Color</a> object, array of
|
|
537
|
+
* color components, or CSS color string.
|
|
538
|
+
* @return the blue value.
|
|
539
|
+
* @example <div>
|
|
540
|
+
* <code>
|
|
541
|
+
* function setup() {
|
|
542
|
+
* createCanvas(100, 100);
|
|
543
|
+
*
|
|
544
|
+
* background(200);
|
|
545
|
+
*
|
|
546
|
+
* // Create a p5.Color object using RGB values.
|
|
547
|
+
* let c = color(175, 100, 220);
|
|
548
|
+
*
|
|
549
|
+
* // Draw the left rectangle.
|
|
550
|
+
* noStroke();
|
|
551
|
+
* fill(c);
|
|
552
|
+
* rect(15, 15, 35, 70);
|
|
553
|
+
*
|
|
554
|
+
* // Set 'blueValue' to 220.
|
|
555
|
+
* let blueValue = blue(c);
|
|
556
|
+
*
|
|
557
|
+
* // Draw the right rectangle.
|
|
558
|
+
* fill(0, 0, blueValue);
|
|
559
|
+
* rect(50, 15, 35, 70);
|
|
560
|
+
*
|
|
561
|
+
* describe('Two rectangles. The left one is light purple and the right one is royal blue.');
|
|
562
|
+
* }
|
|
563
|
+
* </code>
|
|
564
|
+
* </div>
|
|
565
|
+
* @example <div>
|
|
566
|
+
* <code>
|
|
567
|
+
* function setup() {
|
|
568
|
+
* createCanvas(100, 100);
|
|
569
|
+
*
|
|
570
|
+
* background(200);
|
|
571
|
+
*
|
|
572
|
+
* // Create a color array.
|
|
573
|
+
* let c = [175, 100, 220];
|
|
574
|
+
*
|
|
575
|
+
* // Draw the left rectangle.
|
|
576
|
+
* noStroke();
|
|
577
|
+
* fill(c);
|
|
578
|
+
* rect(15, 15, 35, 70);
|
|
579
|
+
*
|
|
580
|
+
* // Set 'blueValue' to 220.
|
|
581
|
+
* let blueValue = blue(c);
|
|
582
|
+
*
|
|
583
|
+
* // Draw the right rectangle.
|
|
584
|
+
* fill(0, 0, blueValue);
|
|
585
|
+
* rect(50, 15, 35, 70);
|
|
586
|
+
*
|
|
587
|
+
* describe('Two rectangles. The left one is light purple and the right one is royal blue.');
|
|
588
|
+
* }
|
|
589
|
+
* </code>
|
|
590
|
+
* </div>
|
|
591
|
+
* @example <div>
|
|
592
|
+
* <code>
|
|
593
|
+
* function setup() {
|
|
594
|
+
* createCanvas(100, 100);
|
|
595
|
+
*
|
|
596
|
+
* background(200);
|
|
597
|
+
*
|
|
598
|
+
* // Create a CSS color string.
|
|
599
|
+
* let c = 'rgb(175, 100, 220)';
|
|
600
|
+
*
|
|
601
|
+
* // Draw the left rectangle.
|
|
602
|
+
* noStroke();
|
|
603
|
+
* fill(c);
|
|
604
|
+
* rect(15, 15, 35, 70);
|
|
605
|
+
*
|
|
606
|
+
* // Set 'blueValue' to 220.
|
|
607
|
+
* let blueValue = blue(c);
|
|
608
|
+
*
|
|
609
|
+
* // Draw the right rectangle.
|
|
610
|
+
* fill(0, 0, blueValue);
|
|
611
|
+
* rect(50, 15, 35, 70);
|
|
612
|
+
*
|
|
613
|
+
* describe('Two rectangles. The left one is light purple and the right one is royal blue.');
|
|
614
|
+
* }
|
|
615
|
+
* </code>
|
|
616
|
+
* </div>
|
|
617
|
+
* @example <div>
|
|
618
|
+
* <code>
|
|
619
|
+
* function setup() {
|
|
620
|
+
* createCanvas(100, 100);
|
|
621
|
+
*
|
|
622
|
+
* background(200);
|
|
623
|
+
*
|
|
624
|
+
* // Use RGB color with values in the range 0-100.
|
|
625
|
+
* colorMode(RGB, 100);
|
|
626
|
+
*
|
|
627
|
+
* // Create a p5.Color object using RGB values.
|
|
628
|
+
* let c = color(69, 39, 86);
|
|
629
|
+
*
|
|
630
|
+
* // Draw the left rectangle.
|
|
631
|
+
* noStroke();
|
|
632
|
+
* fill(c);
|
|
633
|
+
* rect(15, 15, 35, 70);
|
|
634
|
+
*
|
|
635
|
+
* // Set 'blueValue' to 86.
|
|
636
|
+
* let blueValue = blue(c);
|
|
637
|
+
*
|
|
638
|
+
* // Draw the right rectangle.
|
|
639
|
+
* fill(0, 0, blueValue);
|
|
640
|
+
* rect(50, 15, 35, 70);
|
|
641
|
+
*
|
|
642
|
+
* describe('Two rectangles. The left one is light purple and the right one is royal blue.');
|
|
643
|
+
* }
|
|
644
|
+
* </code>
|
|
645
|
+
* </div>
|
|
646
|
+
*/
|
|
647
|
+
function blue(color: p5.Color | number[] | string): number;
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Gets the alpha (transparency) value of a color.`alpha()` extracts the alpha value from a
|
|
651
|
+
* p5.Color object, an array of color components, or
|
|
652
|
+
* a CSS color string.
|
|
653
|
+
*
|
|
654
|
+
* @param <a href="#/p5.Color">p5.Color</a> object, array of
|
|
655
|
+
* color components, or CSS color string.
|
|
656
|
+
* @return the alpha value.
|
|
657
|
+
* @example <div>
|
|
658
|
+
* <code>
|
|
659
|
+
* function setup() {
|
|
660
|
+
* createCanvas(100, 100);
|
|
661
|
+
*
|
|
662
|
+
* background(200);
|
|
663
|
+
*
|
|
664
|
+
* // Create a p5.Color object.
|
|
665
|
+
* let c = color(0, 126, 255, 102);
|
|
666
|
+
*
|
|
667
|
+
* // Draw the left rectangle.
|
|
668
|
+
* noStroke();
|
|
669
|
+
* fill(c);
|
|
670
|
+
* rect(15, 15, 35, 70);
|
|
671
|
+
*
|
|
672
|
+
* // Set 'alphaValue' to 102.
|
|
673
|
+
* let alphaValue = alpha(c);
|
|
674
|
+
*
|
|
675
|
+
* // Draw the right rectangle.
|
|
676
|
+
* fill(alphaValue);
|
|
677
|
+
* rect(50, 15, 35, 70);
|
|
678
|
+
*
|
|
679
|
+
* describe('Two rectangles. The left one is light blue and the right one is charcoal gray.');
|
|
680
|
+
* }
|
|
681
|
+
* </code>
|
|
682
|
+
* </div>
|
|
683
|
+
* @example <div>
|
|
684
|
+
* <code>
|
|
685
|
+
* function setup() {
|
|
686
|
+
* createCanvas(100, 100);
|
|
687
|
+
*
|
|
688
|
+
* background(200);
|
|
689
|
+
*
|
|
690
|
+
* // Create a color array.
|
|
691
|
+
* let c = [0, 126, 255, 102];
|
|
692
|
+
*
|
|
693
|
+
* // Draw the left rectangle.
|
|
694
|
+
* noStroke();
|
|
695
|
+
* fill(c);
|
|
696
|
+
* rect(15, 15, 35, 70);
|
|
697
|
+
*
|
|
698
|
+
* // Set 'alphaValue' to 102.
|
|
699
|
+
* let alphaValue = alpha(c);
|
|
700
|
+
*
|
|
701
|
+
* // Draw the left rectangle.
|
|
702
|
+
* fill(alphaValue);
|
|
703
|
+
* rect(50, 15, 35, 70);
|
|
704
|
+
*
|
|
705
|
+
* describe('Two rectangles. The left one is light blue and the right one is charcoal gray.');
|
|
706
|
+
* }
|
|
707
|
+
* </code>
|
|
708
|
+
* </div>
|
|
709
|
+
* @example <div>
|
|
710
|
+
* <code>
|
|
711
|
+
* function setup() {
|
|
712
|
+
* createCanvas(100, 100);
|
|
713
|
+
*
|
|
714
|
+
* background(200);
|
|
715
|
+
*
|
|
716
|
+
* // Create a CSS color string.
|
|
717
|
+
* let c = 'rgba(0, 126, 255, 0.4)';
|
|
718
|
+
*
|
|
719
|
+
* // Draw the left rectangle.
|
|
720
|
+
* noStroke();
|
|
721
|
+
* fill(c);
|
|
722
|
+
* rect(15, 15, 35, 70);
|
|
723
|
+
*
|
|
724
|
+
* // Set 'alphaValue' to 102.
|
|
725
|
+
* let alphaValue = alpha(c);
|
|
726
|
+
*
|
|
727
|
+
* // Draw the right rectangle.
|
|
728
|
+
* fill(alphaValue);
|
|
729
|
+
* rect(50, 15, 35, 70);
|
|
730
|
+
*
|
|
731
|
+
* describe('Two rectangles. The left one is light blue and the right one is charcoal gray.');
|
|
732
|
+
* }
|
|
733
|
+
* </code>
|
|
734
|
+
* </div>
|
|
735
|
+
*/
|
|
736
|
+
function alpha(color: p5.Color | number[] | string): number;
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Gets the hue value of a color.`hue()` extracts the hue value from a
|
|
740
|
+
* p5.Color object, an array of color components, or
|
|
741
|
+
* a CSS color string.Hue describes a color's position on the color wheel. By default, `hue()`
|
|
742
|
+
* returns a color's HSL hue in the range 0 to 360. If the
|
|
743
|
+
* colorMode() is set to HSB or HSL, it returns the hue
|
|
744
|
+
* value in the given mode.
|
|
745
|
+
*
|
|
746
|
+
* @param <a href="/reference/p5/p5.Color/">p5.Color</a> object, array of
|
|
747
|
+
* color components, or CSS color string.
|
|
748
|
+
* @return the hue value.
|
|
749
|
+
* @example <div>
|
|
750
|
+
* <code>
|
|
751
|
+
* function setup() {
|
|
752
|
+
* createCanvas(100, 100);
|
|
753
|
+
*
|
|
754
|
+
* background(200);
|
|
755
|
+
*
|
|
756
|
+
* // Use HSL color.
|
|
757
|
+
* colorMode(HSL);
|
|
758
|
+
*
|
|
759
|
+
* // Create a p5.Color object.
|
|
760
|
+
* let c = color(0, 50, 100);
|
|
761
|
+
*
|
|
762
|
+
* // Draw the left rectangle.
|
|
763
|
+
* noStroke();
|
|
764
|
+
* fill(c);
|
|
765
|
+
* rect(15, 20, 35, 60);
|
|
766
|
+
*
|
|
767
|
+
* // Set 'hueValue' to 0.
|
|
768
|
+
* let hueValue = hue(c);
|
|
769
|
+
*
|
|
770
|
+
* // Draw the right rectangle.
|
|
771
|
+
* fill(hueValue);
|
|
772
|
+
* rect(50, 20, 35, 60);
|
|
773
|
+
*
|
|
774
|
+
* describe(
|
|
775
|
+
* 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.'
|
|
776
|
+
* );
|
|
777
|
+
* }
|
|
778
|
+
* </code>
|
|
779
|
+
* </div>
|
|
780
|
+
* @example <div>
|
|
781
|
+
* <code>
|
|
782
|
+
* function setup() {
|
|
783
|
+
* createCanvas(100, 100);
|
|
784
|
+
*
|
|
785
|
+
* background(200);
|
|
786
|
+
*
|
|
787
|
+
* // Use HSL color.
|
|
788
|
+
* colorMode(HSL);
|
|
789
|
+
*
|
|
790
|
+
* // Create a color array.
|
|
791
|
+
* let c = [0, 50, 100];
|
|
792
|
+
*
|
|
793
|
+
* // Draw the left rectangle.
|
|
794
|
+
* noStroke();
|
|
795
|
+
* fill(c);
|
|
796
|
+
* rect(15, 20, 35, 60);
|
|
797
|
+
*
|
|
798
|
+
* // Set 'hueValue' to 0.
|
|
799
|
+
* let hueValue = hue(c);
|
|
800
|
+
*
|
|
801
|
+
* // Draw the right rectangle.
|
|
802
|
+
* fill(hueValue);
|
|
803
|
+
* rect(50, 20, 35, 60);
|
|
804
|
+
*
|
|
805
|
+
* describe(
|
|
806
|
+
* 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.'
|
|
807
|
+
* );
|
|
808
|
+
* }
|
|
809
|
+
* </code>
|
|
810
|
+
* </div>
|
|
811
|
+
* @example <div>
|
|
812
|
+
* <code>
|
|
813
|
+
* function setup() {
|
|
814
|
+
* createCanvas(100, 100);
|
|
815
|
+
*
|
|
816
|
+
* background(200);
|
|
817
|
+
*
|
|
818
|
+
* // Use HSL color.
|
|
819
|
+
* colorMode(HSL);
|
|
820
|
+
*
|
|
821
|
+
* // Create a CSS color string.
|
|
822
|
+
* let c = 'rgb(255, 128, 128)';
|
|
823
|
+
*
|
|
824
|
+
* // Draw the left rectangle.
|
|
825
|
+
* noStroke();
|
|
826
|
+
* fill(c);
|
|
827
|
+
* rect(15, 20, 35, 60);
|
|
828
|
+
*
|
|
829
|
+
* // Set 'hueValue' to 0.
|
|
830
|
+
* let hueValue = hue(c);
|
|
831
|
+
*
|
|
832
|
+
* // Draw the right rectangle.
|
|
833
|
+
* fill(hueValue);
|
|
834
|
+
* rect(50, 20, 35, 60);
|
|
835
|
+
*
|
|
836
|
+
* describe(
|
|
837
|
+
* 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.'
|
|
838
|
+
* );
|
|
839
|
+
* }
|
|
840
|
+
* </code>
|
|
841
|
+
* </div>
|
|
842
|
+
*/
|
|
843
|
+
function hue(color: p5.Color | number[] | string): number;
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Gets the saturation value of a color.`saturation()` extracts the saturation value from a
|
|
847
|
+
* p5.Color object, an array of color components, or
|
|
848
|
+
* a CSS color string.Saturation is scaled differently in HSB and HSL. By default, `saturation()`
|
|
849
|
+
* returns a color's HSL saturation in the range 0 to 100. If the
|
|
850
|
+
* colorMode() is set to HSB or HSL, it returns the
|
|
851
|
+
* saturation value in the given mode.
|
|
852
|
+
*
|
|
853
|
+
* @param <a href="/reference/p5/p5.Color/">p5.Color</a> object, array of
|
|
854
|
+
* color components, or CSS color string.
|
|
855
|
+
* @return the saturation value
|
|
856
|
+
* @example <div>
|
|
857
|
+
* <code>
|
|
858
|
+
* function setup() {
|
|
859
|
+
* createCanvas(100, 100);
|
|
860
|
+
*
|
|
861
|
+
* background(50);
|
|
862
|
+
*
|
|
863
|
+
* // Use HSB color.
|
|
864
|
+
* colorMode(HSB);
|
|
865
|
+
*
|
|
866
|
+
* // Create a p5.Color object.
|
|
867
|
+
* let c = color(0, 50, 100);
|
|
868
|
+
*
|
|
869
|
+
* // Draw the left rectangle.
|
|
870
|
+
* noStroke();
|
|
871
|
+
* fill(c);
|
|
872
|
+
* rect(15, 15, 35, 70);
|
|
873
|
+
*
|
|
874
|
+
* // Set 'satValue' to 50.
|
|
875
|
+
* let satValue = saturation(c);
|
|
876
|
+
*
|
|
877
|
+
* // Draw the right rectangle.
|
|
878
|
+
* fill(satValue);
|
|
879
|
+
* rect(50, 15, 35, 70);
|
|
880
|
+
*
|
|
881
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is dark gray.');
|
|
882
|
+
* }
|
|
883
|
+
* </code>
|
|
884
|
+
* </div>
|
|
885
|
+
* @example <div>
|
|
886
|
+
* <code>
|
|
887
|
+
* function setup() {
|
|
888
|
+
* createCanvas(100, 100);
|
|
889
|
+
*
|
|
890
|
+
* background(50);
|
|
891
|
+
*
|
|
892
|
+
* // Use HSB color.
|
|
893
|
+
* colorMode(HSB);
|
|
894
|
+
*
|
|
895
|
+
* // Create a color array.
|
|
896
|
+
* let c = [0, 50, 100];
|
|
897
|
+
*
|
|
898
|
+
* // Draw the left rectangle.
|
|
899
|
+
* noStroke();
|
|
900
|
+
* fill(c);
|
|
901
|
+
* rect(15, 15, 35, 70);
|
|
902
|
+
*
|
|
903
|
+
* // Set 'satValue' to 100.
|
|
904
|
+
* let satValue = saturation(c);
|
|
905
|
+
*
|
|
906
|
+
* // Draw the right rectangle.
|
|
907
|
+
* fill(satValue);
|
|
908
|
+
* rect(50, 15, 35, 70);
|
|
909
|
+
*
|
|
910
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is gray.');
|
|
911
|
+
* }
|
|
912
|
+
* </code>
|
|
913
|
+
* </div>
|
|
914
|
+
* @example <div>
|
|
915
|
+
* <code>
|
|
916
|
+
* function setup() {
|
|
917
|
+
* createCanvas(100, 100);
|
|
918
|
+
*
|
|
919
|
+
* background(50);
|
|
920
|
+
*
|
|
921
|
+
* // Use HSB color.
|
|
922
|
+
* colorMode(HSB);
|
|
923
|
+
*
|
|
924
|
+
* // Create a CSS color string.
|
|
925
|
+
* let c = 'rgb(255, 128, 128)';
|
|
926
|
+
*
|
|
927
|
+
* // Draw the left rectangle.
|
|
928
|
+
* noStroke();
|
|
929
|
+
* fill(c);
|
|
930
|
+
* rect(15, 15, 35, 70);
|
|
931
|
+
*
|
|
932
|
+
* // Set 'satValue' to 100.
|
|
933
|
+
* let satValue = saturation(c);
|
|
934
|
+
*
|
|
935
|
+
* // Draw the right rectangle.
|
|
936
|
+
* fill(satValue);
|
|
937
|
+
* rect(50, 15, 35, 70);
|
|
938
|
+
*
|
|
939
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is gray.');
|
|
940
|
+
* }
|
|
941
|
+
* </code>
|
|
942
|
+
* </div>
|
|
943
|
+
* @example <div>
|
|
944
|
+
* <code>
|
|
945
|
+
* function setup() {
|
|
946
|
+
* createCanvas(100, 100);
|
|
947
|
+
*
|
|
948
|
+
* background(50);
|
|
949
|
+
*
|
|
950
|
+
* // Use HSL color.
|
|
951
|
+
* colorMode(HSL);
|
|
952
|
+
*
|
|
953
|
+
* // Create a p5.Color object.
|
|
954
|
+
* let c = color(0, 100, 75);
|
|
955
|
+
*
|
|
956
|
+
* // Draw the left rectangle.
|
|
957
|
+
* noStroke();
|
|
958
|
+
* fill(c);
|
|
959
|
+
* rect(15, 15, 35, 70);
|
|
960
|
+
*
|
|
961
|
+
* // Set 'satValue' to 100.
|
|
962
|
+
* let satValue = saturation(c);
|
|
963
|
+
*
|
|
964
|
+
* // Draw the right rectangle.
|
|
965
|
+
* fill(satValue);
|
|
966
|
+
* rect(50, 15, 35, 70);
|
|
967
|
+
*
|
|
968
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is white.');
|
|
969
|
+
* }
|
|
970
|
+
* </code>
|
|
971
|
+
* </div>
|
|
972
|
+
* @example <div>
|
|
973
|
+
* <code>
|
|
974
|
+
* function setup() {
|
|
975
|
+
* createCanvas(100, 100);
|
|
976
|
+
*
|
|
977
|
+
* background(50);
|
|
978
|
+
*
|
|
979
|
+
* // Use HSL color with values in the range 0-255.
|
|
980
|
+
* colorMode(HSL, 255);
|
|
981
|
+
*
|
|
982
|
+
* // Create a p5.Color object.
|
|
983
|
+
* let c = color(0, 255, 191.5);
|
|
984
|
+
*
|
|
985
|
+
* // Draw the left rectangle.
|
|
986
|
+
* noStroke();
|
|
987
|
+
* fill(c);
|
|
988
|
+
* rect(15, 15, 35, 70);
|
|
989
|
+
*
|
|
990
|
+
* // Set 'satValue' to 255.
|
|
991
|
+
* let satValue = saturation(c);
|
|
992
|
+
*
|
|
993
|
+
* // Draw the right rectangle.
|
|
994
|
+
* fill(satValue);
|
|
995
|
+
* rect(50, 15, 35, 70);
|
|
996
|
+
*
|
|
997
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is white.');
|
|
998
|
+
* }
|
|
999
|
+
* </code>
|
|
1000
|
+
* </div>
|
|
1001
|
+
*/
|
|
1002
|
+
function saturation(color: p5.Color | number[] | string): number;
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Gets the brightness value of a color.`brightness()` extracts the HSB brightness value from a
|
|
1006
|
+
* p5.Color object, an array of color components, or
|
|
1007
|
+
* a CSS color string.By default, `brightness()` returns a color's HSB brightness in the range 0
|
|
1008
|
+
* to 100. If the colorMode() is set to HSB, it
|
|
1009
|
+
* returns the brightness value in the given range.
|
|
1010
|
+
*
|
|
1011
|
+
* @param <a href="/reference/p5/p5.Color/">p5.Color</a> object, array of
|
|
1012
|
+
* color components, or CSS color string.
|
|
1013
|
+
* @return the brightness value.
|
|
1014
|
+
* @example <div>
|
|
1015
|
+
* <code>
|
|
1016
|
+
* function setup() {
|
|
1017
|
+
* createCanvas(100, 100);
|
|
1018
|
+
*
|
|
1019
|
+
* background(200);
|
|
1020
|
+
*
|
|
1021
|
+
* // Use HSB color.
|
|
1022
|
+
* colorMode(HSB);
|
|
1023
|
+
*
|
|
1024
|
+
* // Create a p5.Color object.
|
|
1025
|
+
* let c = color(0, 50, 100);
|
|
1026
|
+
*
|
|
1027
|
+
* // Draw the left rectangle.
|
|
1028
|
+
* noStroke();
|
|
1029
|
+
* fill(c);
|
|
1030
|
+
* rect(15, 15, 35, 70);
|
|
1031
|
+
*
|
|
1032
|
+
* // Set 'brightValue' to 100.
|
|
1033
|
+
* let brightValue = brightness(c);
|
|
1034
|
+
*
|
|
1035
|
+
* // Draw the right rectangle.
|
|
1036
|
+
* fill(brightValue);
|
|
1037
|
+
* rect(50, 15, 35, 70);
|
|
1038
|
+
*
|
|
1039
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is white.');
|
|
1040
|
+
* }
|
|
1041
|
+
* </code>
|
|
1042
|
+
* </div>
|
|
1043
|
+
* @example <div>
|
|
1044
|
+
* <code>
|
|
1045
|
+
* function setup() {
|
|
1046
|
+
* createCanvas(100, 100);
|
|
1047
|
+
*
|
|
1048
|
+
* background(200);
|
|
1049
|
+
*
|
|
1050
|
+
* // Use HSB color.
|
|
1051
|
+
* colorMode(HSB);
|
|
1052
|
+
*
|
|
1053
|
+
* // Create a color array.
|
|
1054
|
+
* let c = [0, 50, 100];
|
|
1055
|
+
*
|
|
1056
|
+
* // Draw the left rectangle.
|
|
1057
|
+
* noStroke();
|
|
1058
|
+
* fill(c);
|
|
1059
|
+
* rect(15, 15, 35, 70);
|
|
1060
|
+
*
|
|
1061
|
+
* // Set 'brightValue' to 100.
|
|
1062
|
+
* let brightValue = brightness(c);
|
|
1063
|
+
*
|
|
1064
|
+
* // Draw the right rectangle.
|
|
1065
|
+
* fill(brightValue);
|
|
1066
|
+
* rect(50, 15, 35, 70);
|
|
1067
|
+
*
|
|
1068
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is white.');
|
|
1069
|
+
* }
|
|
1070
|
+
* </code>
|
|
1071
|
+
* </div>
|
|
1072
|
+
* @example <div>
|
|
1073
|
+
* <code>
|
|
1074
|
+
* function setup() {
|
|
1075
|
+
* createCanvas(100, 100);
|
|
1076
|
+
*
|
|
1077
|
+
* background(200);
|
|
1078
|
+
*
|
|
1079
|
+
* // Use HSB color.
|
|
1080
|
+
* colorMode(HSB);
|
|
1081
|
+
*
|
|
1082
|
+
* // Create a CSS color string.
|
|
1083
|
+
* let c = 'rgb(255, 128, 128)';
|
|
1084
|
+
*
|
|
1085
|
+
* // Draw the left rectangle.
|
|
1086
|
+
* noStroke();
|
|
1087
|
+
* fill(c);
|
|
1088
|
+
* rect(15, 15, 35, 70);
|
|
1089
|
+
*
|
|
1090
|
+
* // Set 'brightValue' to 100.
|
|
1091
|
+
* let brightValue = brightness(c);
|
|
1092
|
+
*
|
|
1093
|
+
* // Draw the right rectangle.
|
|
1094
|
+
* fill(brightValue);
|
|
1095
|
+
* rect(50, 15, 35, 70);
|
|
1096
|
+
*
|
|
1097
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is white.');
|
|
1098
|
+
* }
|
|
1099
|
+
* </code>
|
|
1100
|
+
* </div>
|
|
1101
|
+
* @example <div>
|
|
1102
|
+
* <code>
|
|
1103
|
+
* function setup() {
|
|
1104
|
+
* createCanvas(100, 100);
|
|
1105
|
+
*
|
|
1106
|
+
* background(200);
|
|
1107
|
+
*
|
|
1108
|
+
* // Use HSB color with values in the range 0-255.
|
|
1109
|
+
* colorMode(HSB, 255);
|
|
1110
|
+
*
|
|
1111
|
+
* // Create a p5.Color object.
|
|
1112
|
+
* let c = color(0, 127, 255);
|
|
1113
|
+
*
|
|
1114
|
+
* // Draw the left rectangle.
|
|
1115
|
+
* noStroke();
|
|
1116
|
+
* fill(c);
|
|
1117
|
+
* rect(15, 15, 35, 70);
|
|
1118
|
+
*
|
|
1119
|
+
* // Set 'brightValue' to 255.
|
|
1120
|
+
* let brightValue = brightness(c);
|
|
1121
|
+
*
|
|
1122
|
+
* // Draw the right rectangle.
|
|
1123
|
+
* fill(brightValue);
|
|
1124
|
+
* rect(50, 15, 35, 70);
|
|
1125
|
+
*
|
|
1126
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is white.');
|
|
1127
|
+
* }
|
|
1128
|
+
* </code>
|
|
1129
|
+
* </div>
|
|
1130
|
+
*/
|
|
1131
|
+
function brightness(color: p5.Color | number[] | string): number;
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Gets the lightness value of a color.`lightness()` extracts the HSL lightness value from a
|
|
1135
|
+
* p5.Color object, an array of color components, or
|
|
1136
|
+
* a CSS color string.By default, `lightness()` returns a color's HSL lightness in the range 0
|
|
1137
|
+
* to 100. If the colorMode() is set to HSL, it
|
|
1138
|
+
* returns the lightness value in the given range.
|
|
1139
|
+
*
|
|
1140
|
+
* @param <a href="/reference/p5/p5.Color/">p5.Color</a> object, array of
|
|
1141
|
+
* color components, or CSS color string.
|
|
1142
|
+
* @return the lightness value.
|
|
1143
|
+
* @example <div>
|
|
1144
|
+
* <code>
|
|
1145
|
+
* function setup() {
|
|
1146
|
+
* createCanvas(100, 100);
|
|
1147
|
+
*
|
|
1148
|
+
* background(50);
|
|
1149
|
+
*
|
|
1150
|
+
* // Use HSL color.
|
|
1151
|
+
* colorMode(HSL);
|
|
1152
|
+
*
|
|
1153
|
+
* // Create a p5.Color object using HSL values.
|
|
1154
|
+
* let c = color(0, 100, 75);
|
|
1155
|
+
*
|
|
1156
|
+
* // Draw the left rectangle.
|
|
1157
|
+
* noStroke();
|
|
1158
|
+
* fill(c);
|
|
1159
|
+
* rect(15, 15, 35, 70);
|
|
1160
|
+
*
|
|
1161
|
+
* // Set 'lightValue' to 75.
|
|
1162
|
+
* let lightValue = lightness(c);
|
|
1163
|
+
*
|
|
1164
|
+
* // Draw the right rectangle.
|
|
1165
|
+
* fill(lightValue);
|
|
1166
|
+
* rect(50, 15, 35, 70);
|
|
1167
|
+
*
|
|
1168
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is gray.');
|
|
1169
|
+
* }
|
|
1170
|
+
* </code>
|
|
1171
|
+
* </div>
|
|
1172
|
+
* @example <div>
|
|
1173
|
+
* <code>
|
|
1174
|
+
* function setup() {
|
|
1175
|
+
* createCanvas(100, 100);
|
|
1176
|
+
*
|
|
1177
|
+
* background(50);
|
|
1178
|
+
*
|
|
1179
|
+
* // Use HSL color.
|
|
1180
|
+
* colorMode(HSL);
|
|
1181
|
+
*
|
|
1182
|
+
* // Create a color array.
|
|
1183
|
+
* let c = [0, 100, 75];
|
|
1184
|
+
*
|
|
1185
|
+
* // Draw the left rectangle.
|
|
1186
|
+
* noStroke();
|
|
1187
|
+
* fill(c);
|
|
1188
|
+
* rect(15, 15, 35, 70);
|
|
1189
|
+
*
|
|
1190
|
+
* // Set 'lightValue' to 75.
|
|
1191
|
+
* let lightValue = lightness(c);
|
|
1192
|
+
*
|
|
1193
|
+
* // Draw the right rectangle.
|
|
1194
|
+
* fill(lightValue);
|
|
1195
|
+
* rect(50, 15, 35, 70);
|
|
1196
|
+
*
|
|
1197
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is gray.');
|
|
1198
|
+
* }
|
|
1199
|
+
* </code>
|
|
1200
|
+
* </div>
|
|
1201
|
+
* @example <div>
|
|
1202
|
+
* <code>
|
|
1203
|
+
* function setup() {
|
|
1204
|
+
* createCanvas(100, 100);
|
|
1205
|
+
*
|
|
1206
|
+
* background(50);
|
|
1207
|
+
*
|
|
1208
|
+
* // Use HSL color.
|
|
1209
|
+
* colorMode(HSL);
|
|
1210
|
+
*
|
|
1211
|
+
* // Create a CSS color string.
|
|
1212
|
+
* let c = 'rgb(255, 128, 128)';
|
|
1213
|
+
*
|
|
1214
|
+
* // Draw the left rectangle.
|
|
1215
|
+
* noStroke();
|
|
1216
|
+
* fill(c);
|
|
1217
|
+
* rect(15, 15, 35, 70);
|
|
1218
|
+
*
|
|
1219
|
+
* // Set 'lightValue' to 75.
|
|
1220
|
+
* let lightValue = lightness(c);
|
|
1221
|
+
*
|
|
1222
|
+
* // Draw the right rectangle.
|
|
1223
|
+
* fill(lightValue);
|
|
1224
|
+
* rect(50, 15, 35, 70);
|
|
1225
|
+
*
|
|
1226
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is gray.');
|
|
1227
|
+
* }
|
|
1228
|
+
* </code>
|
|
1229
|
+
* </div>
|
|
1230
|
+
* @example <div>
|
|
1231
|
+
* <code>
|
|
1232
|
+
* function setup() {
|
|
1233
|
+
* createCanvas(100, 100);
|
|
1234
|
+
*
|
|
1235
|
+
* background(50);
|
|
1236
|
+
*
|
|
1237
|
+
* // Use HSL color with values in the range 0-255.
|
|
1238
|
+
* colorMode(HSL, 255);
|
|
1239
|
+
*
|
|
1240
|
+
* // Create a p5.Color object using HSL values.
|
|
1241
|
+
* let c = color(0, 255, 191.5);
|
|
1242
|
+
*
|
|
1243
|
+
* // Draw the left rectangle.
|
|
1244
|
+
* noStroke();
|
|
1245
|
+
* fill(c);
|
|
1246
|
+
* rect(15, 15, 35, 70);
|
|
1247
|
+
*
|
|
1248
|
+
* // Set 'lightValue' to 191.5.
|
|
1249
|
+
* let lightValue = lightness(c);
|
|
1250
|
+
*
|
|
1251
|
+
* // Draw the right rectangle.
|
|
1252
|
+
* fill(lightValue);
|
|
1253
|
+
* rect(50, 15, 35, 70);
|
|
1254
|
+
*
|
|
1255
|
+
* describe('Two rectangles. The left one is salmon pink and the right one is gray.');
|
|
1256
|
+
* }
|
|
1257
|
+
* </code>
|
|
1258
|
+
* </div>
|
|
1259
|
+
*/
|
|
1260
|
+
function lightness(color: p5.Color | number[] | string): number;
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* Blends two colors to find a third color between them.The `amt` parameter specifies the amount to interpolate between the two
|
|
1264
|
+
* values. 0 is equal to the first color, 0.1 is very near the first color,
|
|
1265
|
+
* 0.5 is halfway between the two colors, and so on. Negative numbers are set
|
|
1266
|
+
* to 0. Numbers greater than 1 are set to 1. This differs from the behavior of
|
|
1267
|
+
* lerp. It's necessary because numbers outside of the
|
|
1268
|
+
* interval [0, 1] will produce strange and unexpected colors.The way that colors are interpolated depends on the current
|
|
1269
|
+
* colorMode().
|
|
1270
|
+
*
|
|
1271
|
+
* @param interpolate from this color.
|
|
1272
|
+
* @param interpolate to this color.
|
|
1273
|
+
* @param number between 0 and 1.
|
|
1274
|
+
* @return interpolated color.
|
|
1275
|
+
* @example <div>
|
|
1276
|
+
* <code>
|
|
1277
|
+
* function setup() {
|
|
1278
|
+
* createCanvas(100, 100);
|
|
1279
|
+
*
|
|
1280
|
+
* background(200);
|
|
1281
|
+
*
|
|
1282
|
+
* // Create p5.Color objects to interpolate between.
|
|
1283
|
+
* let from = color(218, 165, 32);
|
|
1284
|
+
* let to = color(72, 61, 139);
|
|
1285
|
+
*
|
|
1286
|
+
* // Create intermediate colors.
|
|
1287
|
+
* let interA = lerpColor(from, to, 0.33);
|
|
1288
|
+
* let interB = lerpColor(from, to, 0.66);
|
|
1289
|
+
*
|
|
1290
|
+
* // Draw the left rectangle.
|
|
1291
|
+
* noStroke();
|
|
1292
|
+
* fill(from);
|
|
1293
|
+
* rect(10, 20, 20, 60);
|
|
1294
|
+
*
|
|
1295
|
+
* // Draw the left-center rectangle.
|
|
1296
|
+
* fill(interA);
|
|
1297
|
+
* rect(30, 20, 20, 60);
|
|
1298
|
+
*
|
|
1299
|
+
* // Draw the right-center rectangle.
|
|
1300
|
+
* fill(interB);
|
|
1301
|
+
* rect(50, 20, 20, 60);
|
|
1302
|
+
*
|
|
1303
|
+
* // Draw the right rectangle.
|
|
1304
|
+
* fill(to);
|
|
1305
|
+
* rect(70, 20, 20, 60);
|
|
1306
|
+
*
|
|
1307
|
+
* describe(
|
|
1308
|
+
* 'Four rectangles. From left to right, the rectangles are tan, brown, brownish purple, and purple.'
|
|
1309
|
+
* );
|
|
1310
|
+
* }
|
|
1311
|
+
* </code>
|
|
1312
|
+
* </div>
|
|
1313
|
+
*/
|
|
1314
|
+
function lerpColor(c1: p5.Color, c2: p5.Color, amt: number): p5.Color;
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* Blends multiple colors to find a color between them.The `amt` parameter specifies the amount to interpolate between the color
|
|
1318
|
+
* stops which are colors at each `amt` value "location" with `amt` values
|
|
1319
|
+
* that are between 2 color stops interpolating between them based on its relative
|
|
1320
|
+
* distance to both.The way that colors are interpolated depends on the current
|
|
1321
|
+
* colorMode().
|
|
1322
|
+
*
|
|
1323
|
+
* @param color stops to interpolate from
|
|
1324
|
+
* @param number to use to interpolate relative to color stops
|
|
1325
|
+
* @return interpolated color.
|
|
1326
|
+
* @example <div>
|
|
1327
|
+
* <code>
|
|
1328
|
+
* function setup() {
|
|
1329
|
+
* createCanvas(400, 400);
|
|
1330
|
+
* }
|
|
1331
|
+
*
|
|
1332
|
+
* function draw() {
|
|
1333
|
+
* // The background goes from white to red to green to blue fill
|
|
1334
|
+
* background(paletteLerp([
|
|
1335
|
+
* ['white', 0],
|
|
1336
|
+
* ['red', 0.05],
|
|
1337
|
+
* ['green', 0.25],
|
|
1338
|
+
* ['blue', 1]
|
|
1339
|
+
* ], millis() / 10000 % 1));
|
|
1340
|
+
* }
|
|
1341
|
+
* </code>
|
|
1342
|
+
* </div>
|
|
1343
|
+
*/
|
|
1344
|
+
function paletteLerp(colors_stops: [p5.Color | string | number | number[], number][], amt: number): p5.Color;
|
|
1345
|
+
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
export default function creating_reading(p5: any, fn: any): void;
|