p5 2.2.1-rc.0 → 2.2.1

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.
Files changed (117) hide show
  1. package/dist/accessibility/color_namer.js +5 -6
  2. package/dist/accessibility/describe.js +4 -26
  3. package/dist/accessibility/index.js +5 -6
  4. package/dist/accessibility/outputs.js +6 -38
  5. package/dist/app.js +5 -6
  6. package/dist/color/color_conversion.js +5 -6
  7. package/dist/color/creating_reading.js +1 -1
  8. package/dist/color/index.js +2 -2
  9. package/dist/color/p5.Color.js +1 -1
  10. package/dist/color/setting.js +59 -357
  11. package/dist/{constants-DEJVKr9Z.js → constants-DQyACdzq.js} +11 -61
  12. package/dist/core/constants.js +1 -1
  13. package/dist/core/environment.js +26 -158
  14. package/dist/core/filterShaders.js +1 -1
  15. package/dist/core/friendly_errors/fes_core.js +1 -1
  16. package/dist/core/friendly_errors/file_errors.js +1 -1
  17. package/dist/core/friendly_errors/index.js +1 -1
  18. package/dist/core/friendly_errors/param_validator.js +1 -1
  19. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  20. package/dist/core/helpers.js +1 -1
  21. package/dist/core/init.js +5 -6
  22. package/dist/core/internationalization.js +1 -1
  23. package/dist/core/legacy.js +5 -6
  24. package/dist/core/main.js +5 -6
  25. package/dist/core/p5.Graphics.js +4 -5
  26. package/dist/core/p5.Renderer.js +3 -4
  27. package/dist/core/p5.Renderer2D.js +5 -6
  28. package/dist/core/p5.Renderer3D.js +4 -5
  29. package/dist/core/rendering.js +4 -5
  30. package/dist/core/structure.js +13 -52
  31. package/dist/core/transform.js +32 -176
  32. package/dist/{creating_reading-CgHCHxqN.js → creating_reading-ZXzcZEsb.js} +3 -196
  33. package/dist/data/local_storage.js +4 -30
  34. package/dist/dom/dom.js +24 -159
  35. package/dist/dom/index.js +2 -2
  36. package/dist/dom/p5.Element.js +31 -208
  37. package/dist/dom/p5.File.js +1 -32
  38. package/dist/dom/p5.MediaElement.js +10 -113
  39. package/dist/events/acceleration.js +11 -64
  40. package/dist/events/keyboard.js +13 -81
  41. package/dist/events/pointer.js +18 -160
  42. package/dist/image/const.js +1 -1
  43. package/dist/image/filterRenderer2D.js +4 -5
  44. package/dist/image/image.js +4 -5
  45. package/dist/image/index.js +4 -5
  46. package/dist/image/loading_displaying.js +4 -5
  47. package/dist/image/p5.Image.js +3 -4
  48. package/dist/image/pixels.js +17 -100
  49. package/dist/io/files.js +4 -5
  50. package/dist/io/index.js +4 -5
  51. package/dist/io/p5.Table.js +66 -158
  52. package/dist/io/p5.TableRow.js +48 -71
  53. package/dist/io/p5.XML.js +6 -99
  54. package/dist/io/utilities.js +8 -3
  55. package/dist/{main-_RXV5Lx8.js → main-DvN69W3f.js} +13 -42
  56. package/dist/math/Matrices/Matrix.js +87 -126
  57. package/dist/math/Matrices/MatrixNumjs.js +1 -5
  58. package/dist/math/calculation.js +10 -112
  59. package/dist/math/index.js +1 -1
  60. package/dist/math/math.js +2 -12
  61. package/dist/math/noise.js +5 -32
  62. package/dist/math/p5.Matrix.js +3 -3
  63. package/dist/math/p5.Vector.js +104 -345
  64. package/dist/math/random.js +5 -32
  65. package/dist/math/trigonometry.js +15 -105
  66. package/dist/{p5.Renderer-QoFcvj3f.js → p5.Renderer-D-5LdCRz.js} +25 -178
  67. package/dist/{rendering-CsICjEXA.js → rendering-h9unX5K0.js} +254 -1156
  68. package/dist/shape/2d_primitives.js +33 -194
  69. package/dist/shape/attributes.js +12 -73
  70. package/dist/shape/curves.js +30 -95
  71. package/dist/shape/custom_shapes.js +63 -144
  72. package/dist/shape/index.js +2 -2
  73. package/dist/shape/vertex.js +21 -106
  74. package/dist/strands/p5.strands.js +248 -46
  75. package/dist/type/index.js +3 -4
  76. package/dist/type/p5.Font.js +4 -49
  77. package/dist/type/textCore.js +5 -158
  78. package/dist/utilities/conversion.js +17 -104
  79. package/dist/utilities/time_date.js +3 -40
  80. package/dist/utilities/utility_functions.js +6 -48
  81. package/dist/webgl/3d_primitives.js +4 -5
  82. package/dist/webgl/GeometryBuilder.js +1 -2
  83. package/dist/webgl/ShapeBuilder.js +22 -2
  84. package/dist/webgl/enums.js +1 -1
  85. package/dist/webgl/index.js +4 -5
  86. package/dist/webgl/interaction.js +6 -33
  87. package/dist/webgl/light.js +4 -5
  88. package/dist/webgl/loading.js +12 -46
  89. package/dist/webgl/material.js +4 -5
  90. package/dist/webgl/p5.Camera.js +4 -5
  91. package/dist/webgl/p5.DataArray.js +0 -4
  92. package/dist/webgl/p5.Framebuffer.js +4 -5
  93. package/dist/webgl/p5.Geometry.js +12 -106
  94. package/dist/webgl/p5.Quat.js +1 -1
  95. package/dist/webgl/p5.RendererGL.js +7 -18
  96. package/dist/webgl/p5.Shader.js +12 -36
  97. package/dist/webgl/p5.Texture.js +4 -5
  98. package/dist/webgl/text.js +4 -5
  99. package/dist/webgl/utils.js +4 -5
  100. package/dist/webgpu/index.js +1 -1
  101. package/dist/webgpu/p5.RendererWebGPU.js +529 -208
  102. package/dist/webgpu/shaders/color.js +32 -17
  103. package/dist/webgpu/shaders/filters/base.js +18 -7
  104. package/dist/webgpu/shaders/font.js +52 -40
  105. package/dist/webgpu/shaders/line.js +50 -36
  106. package/dist/webgpu/shaders/material.js +90 -83
  107. package/dist/webgpu/strands_wgslBackend.js +5 -2
  108. package/lib/p5.esm.js +5576 -7811
  109. package/lib/p5.esm.min.js +1 -1
  110. package/lib/p5.js +5576 -7811
  111. package/lib/p5.min.js +1 -1
  112. package/lib/p5.webgpu.esm.js +786 -453
  113. package/lib/p5.webgpu.js +786 -453
  114. package/lib/p5.webgpu.min.js +1 -1
  115. package/package.json +13 -13
  116. package/types/global.d.ts +16905 -16783
  117. package/types/p5.d.ts +11142 -11081
@@ -1,5 +1,5 @@
1
- import { a2 as NORMAL, B as BLEND } from '../constants-DEJVKr9Z.js';
2
- import { R as RGB, b as RGBHDR, H as HSB, d as HSL, e as HWB, L as LAB, f as LCH, O as OKLAB, g as OKLCH } from '../creating_reading-CgHCHxqN.js';
1
+ import { a2 as NORMAL, B as BLEND } from '../constants-DQyACdzq.js';
2
+ import { R as RGB, b as RGBHDR, H as HSB, d as HSL, e as HWB, L as LAB, f as LCH, O as OKLAB, g as OKLCH } from '../creating_reading-ZXzcZEsb.js';
3
3
  import 'colorjs.io/fn';
4
4
  import './color_spaces/hsb.js';
5
5
 
@@ -37,8 +37,6 @@ function setting(p5, fn){
37
37
  * @param {Boolean} [options.invert=false] Whether or not to invert the mask.
38
38
  *
39
39
  * @example
40
- * <div>
41
- * <code>
42
40
  * function setup() {
43
41
  * createCanvas(100, 100);
44
42
  *
@@ -55,12 +53,8 @@ function setting(p5, fn){
55
53
  *
56
54
  * describe('A white triangle and circle on a gray background.');
57
55
  * }
58
- * </code>
59
- * </div>
60
56
  *
61
57
  * @example
62
- * <div>
63
- * <code>
64
58
  * function setup() {
65
59
  * createCanvas(100, 100);
66
60
  *
@@ -77,11 +71,8 @@ function setting(p5, fn){
77
71
  *
78
72
  * describe('A white square at the top-left corner of a gray square. The white square has a triangle and a circle cut out of it.');
79
73
  * }
80
- * </code>
81
- * </div>
82
74
  *
83
- * <div>
84
- * <code>
75
+ * @example
85
76
  * function setup() {
86
77
  * createCanvas(100, 100);
87
78
  *
@@ -118,12 +109,8 @@ function setting(p5, fn){
118
109
  *
119
110
  * describe('In the top left, a white triangle and circle. In the bottom right, a white square with a triangle and circle cut out of it.');
120
111
  * }
121
- * </code>
122
- * </div>
123
112
  *
124
113
  * @example
125
- * <div>
126
- * <code>
127
114
  * function setup() {
128
115
  * createCanvas(100, 100, WEBGL);
129
116
  *
@@ -148,12 +135,8 @@ function setting(p5, fn){
148
135
  * fill('fuchsia');
149
136
  * plane(100);
150
137
  * }
151
- * </code>
152
- * </div>
153
138
  *
154
139
  * @example
155
- * <div>
156
- * <code>
157
140
  * function setup() {
158
141
  * createCanvas(100, 100, WEBGL);
159
142
  *
@@ -184,8 +167,6 @@ function setting(p5, fn){
184
167
  * vertex(width / 2, height / 2);
185
168
  * endShape();
186
169
  * }
187
- * </code>
188
- * </div>
189
170
  */
190
171
  fn.beginClip = function(options = {}) {
191
172
  this._renderer.beginClip(options);
@@ -198,8 +179,6 @@ function setting(p5, fn){
198
179
  * @method endClip
199
180
  *
200
181
  * @example
201
- * <div>
202
- * <code>
203
182
  * function setup() {
204
183
  * createCanvas(100, 100);
205
184
  *
@@ -216,8 +195,6 @@ function setting(p5, fn){
216
195
  *
217
196
  * describe('A white triangle and circle on a gray background.');
218
197
  * }
219
- * </code>
220
- * </div>
221
198
  */
222
199
  fn.endClip = function() {
223
200
  this._renderer.endClip();
@@ -248,8 +225,6 @@ function setting(p5, fn){
248
225
  * @param {Boolean} [options.invert=false] Whether or not to invert the mask.
249
226
  *
250
227
  * @example
251
- * <div>
252
- * <code>
253
228
  * function setup() {
254
229
  * createCanvas(100, 100);
255
230
  *
@@ -269,12 +244,8 @@ function setting(p5, fn){
269
244
  * triangle(15, 37, 30, 13, 43, 37);
270
245
  * circle(45, 45, 7);
271
246
  * }
272
- * </code>
273
- * </div>
274
247
  *
275
248
  * @example
276
- * <div>
277
- * <code>
278
249
  * function setup() {
279
250
  * createCanvas(100, 100);
280
251
  *
@@ -294,11 +265,8 @@ function setting(p5, fn){
294
265
  * triangle(15, 37, 30, 13, 43, 37);
295
266
  * circle(45, 45, 7);
296
267
  * }
297
- * </code>
298
- * </div>
299
268
  *
300
- * <div>
301
- * <code>
269
+ * @example
302
270
  * function setup() {
303
271
  * createCanvas(100, 100);
304
272
  *
@@ -335,12 +303,8 @@ function setting(p5, fn){
335
303
  * triangle(15, 37, 30, 13, 43, 37);
336
304
  * circle(45, 45, 7);
337
305
  * }
338
- * </code>
339
- * </div>
340
306
  *
341
307
  * @example
342
- * <div>
343
- * <code>
344
308
  * function setup() {
345
309
  * createCanvas(100, 100, WEBGL);
346
310
  *
@@ -368,12 +332,8 @@ function setting(p5, fn){
368
332
  * torus(30, 15);
369
333
  * pop();
370
334
  * }
371
- * </code>
372
- * </div>
373
335
  *
374
336
  * @example
375
- * <div>
376
- * <code>
377
337
  * function setup() {
378
338
  * createCanvas(100, 100, WEBGL);
379
339
  *
@@ -407,8 +367,6 @@ function setting(p5, fn){
407
367
  * torus(30, 15);
408
368
  * pop();
409
369
  * }
410
- * </code>
411
- * </div>
412
370
  */
413
371
  fn.clip = function(callback, options) {
414
372
  this._renderer.beginClip(options);
@@ -454,8 +412,6 @@ function setting(p5, fn){
454
412
  * @chainable
455
413
  *
456
414
  * @example
457
- * <div>
458
- * <code>
459
415
  * function setup() {
460
416
  * createCanvas(100, 100);
461
417
  *
@@ -464,11 +420,8 @@ function setting(p5, fn){
464
420
  *
465
421
  * describe('A canvas with a dark charcoal gray background.');
466
422
  * }
467
- * </code>
468
- * </div>
469
423
  *
470
- * <div>
471
- * <code>
424
+ * @example
472
425
  * function setup() {
473
426
  * createCanvas(100, 100);
474
427
  *
@@ -476,11 +429,8 @@ function setting(p5, fn){
476
429
  * background(51, 0.4);
477
430
  * describe('A canvas with a transparent gray background.');
478
431
  * }
479
- * </code>
480
- * </div>
481
432
  *
482
- * <div>
483
- * <code>
433
+ * @example
484
434
  * function setup() {
485
435
  * createCanvas(100, 100);
486
436
  *
@@ -489,11 +439,8 @@ function setting(p5, fn){
489
439
  *
490
440
  * describe('A canvas with a yellow background.');
491
441
  * }
492
- * </code>
493
- * </div>
494
442
  *
495
- * <div>
496
- * <code>
443
+ * @example
497
444
  * function setup() {
498
445
  * createCanvas(100, 100);
499
446
  *
@@ -502,11 +449,8 @@ function setting(p5, fn){
502
449
  *
503
450
  * describe('A canvas with a semi-transparent red background.');
504
451
  * }
505
- * </code>
506
- * </div>
507
452
  *
508
- * <div>
509
- * <code>
453
+ * @example
510
454
  * function setup() {
511
455
  * createCanvas(100, 100);
512
456
  *
@@ -518,11 +462,8 @@ function setting(p5, fn){
518
462
  *
519
463
  * describe('A canvas with a royal blue background.');
520
464
  * }
521
- * </code>
522
- * </div>
523
465
  *
524
- * <div>
525
- * <code>
466
+ * @example
526
467
  * function setup() {
527
468
  * createCanvas(100, 100);
528
469
  *
@@ -531,11 +472,8 @@ function setting(p5, fn){
531
472
  *
532
473
  * describe('A canvas with a red background.');
533
474
  * }
534
- * </code>
535
- * </div>
536
475
  *
537
- * <div>
538
- * <code>
476
+ * @example
539
477
  * function setup() {
540
478
  * createCanvas(100, 100);
541
479
  *
@@ -544,11 +482,8 @@ function setting(p5, fn){
544
482
  *
545
483
  * describe('A canvas with a pink background.');
546
484
  * }
547
- * </code>
548
- * </div>
549
485
  *
550
- * <div>
551
- * <code>
486
+ * @example
552
487
  * function setup() {
553
488
  * createCanvas(100, 100);
554
489
  *
@@ -557,11 +492,8 @@ function setting(p5, fn){
557
492
  *
558
493
  * describe('A canvas with a black background.');
559
494
  * }
560
- * </code>
561
- * </div>
562
495
  *
563
- * <div>
564
- * <code>
496
+ * @example
565
497
  * function setup() {
566
498
  * createCanvas(100, 100);
567
499
  *
@@ -570,11 +502,8 @@ function setting(p5, fn){
570
502
  *
571
503
  * describe('A canvas with a bright green background.');
572
504
  * }
573
- * </code>
574
- * </div>
575
505
  *
576
- * <div>
577
- * <code>
506
+ * @example
578
507
  * function setup() {
579
508
  * createCanvas(100, 100);
580
509
  *
@@ -583,11 +512,8 @@ function setting(p5, fn){
583
512
  *
584
513
  * describe('A canvas with a transparent green background.');
585
514
  * }
586
- * </code>
587
- * </div>
588
- *
589
- * <div>
590
- * <code>
515
+ * <
516
+ * @example
591
517
  * function setup() {
592
518
  * createCanvas(100, 100);
593
519
  *
@@ -596,11 +522,8 @@ function setting(p5, fn){
596
522
  *
597
523
  * describe('A canvas with a red background.');
598
524
  * }
599
- * </code>
600
- * </div>
601
525
  *
602
- * <div>
603
- * <code>
526
+ * @example
604
527
  * function setup() {
605
528
  * createCanvas(100, 100);
606
529
  *
@@ -609,11 +532,8 @@ function setting(p5, fn){
609
532
  *
610
533
  * describe('A canvas with a transparent purple background.');
611
534
  * }
612
- * </code>
613
- * </div>
614
535
  *
615
- * <div>
616
- * <code>
536
+ * @example
617
537
  * function setup() {
618
538
  * createCanvas(100, 100);
619
539
  *
@@ -623,11 +543,7 @@ function setting(p5, fn){
623
543
  *
624
544
  * describe('A canvas with a blue background.');
625
545
  * }
626
- * </code>
627
- * </div>
628
- *
629
546
  */
630
-
631
547
  /**
632
548
  * @method background
633
549
  * @param {String} colorstring color string, possible formats include: integer
@@ -637,14 +553,12 @@ function setting(p5, fn){
637
553
  * color range (default is 0-255).
638
554
  * @chainable
639
555
  */
640
-
641
556
  /**
642
557
  * @method background
643
558
  * @param {Number} gray specifies a value between white and black.
644
559
  * @param {Number} [a]
645
560
  * @chainable
646
561
  */
647
-
648
562
  /**
649
563
  * @method background
650
564
  * @param {Number} v1 red value if color mode is RGB, or hue value if color mode is HSB.
@@ -653,14 +567,12 @@ function setting(p5, fn){
653
567
  * @param {Number} [a]
654
568
  * @chainable
655
569
  */
656
-
657
570
  /**
658
571
  * @method background
659
572
  * @param {Number[]} values an array containing the red, green, blue
660
573
  * and alpha components of the color.
661
574
  * @chainable
662
575
  */
663
-
664
576
  /**
665
577
  * @method background
666
578
  * @param {p5.Image} image image created with <a href="#/p5/loadImage">loadImage()</a>
@@ -693,8 +605,6 @@ function setting(p5, fn){
693
605
  * @method clear
694
606
  * @chainable
695
607
  * @example
696
- * <div>
697
- * <code>
698
608
  * function setup() {
699
609
  * createCanvas(100, 100);
700
610
  *
@@ -711,11 +621,8 @@ function setting(p5, fn){
711
621
  * clear();
712
622
  * background(200);
713
623
  * }
714
- * </code>
715
- * </div>
716
624
  *
717
- * <div>
718
- * <code>
625
+ * @example
719
626
  * let pg;
720
627
  *
721
628
  * function setup() {
@@ -735,8 +642,6 @@ function setting(p5, fn){
735
642
  * clear();
736
643
  * image(pg, 20, 20);
737
644
  * }
738
- * </code>
739
- * </div>
740
645
  *
741
646
  * @param {Number} [r] normalized red value.
742
647
  * @param {Number} [g] normalized green value.
@@ -827,8 +732,6 @@ function setting(p5, fn){
827
732
  * @return {RGB|HSB|HSL|RGBHDR|HWB|LAB|LCH|OKLAB|OKLCH} The current color mode.
828
733
  *
829
734
  * @example
830
- * <div>
831
- * <code>
832
735
  * function setup() {
833
736
  * createCanvas(100, 100);
834
737
  *
@@ -841,12 +744,8 @@ function setting(p5, fn){
841
744
  *
842
745
  * describe('A gray square with a red circle at its center.');
843
746
  * }
844
- * </code>
845
- * </div>
846
747
  *
847
748
  * @example
848
- * <div>
849
- * <code>
850
749
  * function setup() {
851
750
  * createCanvas(100, 100);
852
751
  *
@@ -862,12 +761,8 @@ function setting(p5, fn){
862
761
  *
863
762
  * describe('A gray square with a red circle at its center.');
864
763
  * }
865
- * </code>
866
- * </div>
867
764
  *
868
765
  * @example
869
- * <div>
870
- * <code>
871
766
  * function setup() {
872
767
  * createCanvas(100, 100);
873
768
  *
@@ -883,12 +778,8 @@ function setting(p5, fn){
883
778
  *
884
779
  * describe('A gray square with a red circle at its center.');
885
780
  * }
886
- * </code>
887
- * </div>
888
781
  *
889
782
  * @example
890
- * <div>
891
- * <code>
892
783
  * function setup() {
893
784
  * createCanvas(100, 100);
894
785
  *
@@ -904,12 +795,8 @@ function setting(p5, fn){
904
795
  *
905
796
  * describe('A gray square with a red circle at its center.');
906
797
  * }
907
- * </code>
908
- * </div>
909
798
  *
910
799
  * @example
911
- * <div>
912
- * <code>
913
800
  * function setup() {
914
801
  * createCanvas(100, 100);
915
802
  *
@@ -930,12 +817,8 @@ function setting(p5, fn){
930
817
  *
931
818
  * describe('A gray square with a red circle at its center, drawn using HWB color mode.');
932
819
  * }
933
- * </code>
934
- * </div>
935
820
  *
936
821
  * @example
937
- * <div>
938
- * <code>
939
822
  * function setup() {
940
823
  * createCanvas(100, 100);
941
824
  *
@@ -956,12 +839,8 @@ function setting(p5, fn){
956
839
  *
957
840
  * describe('A gray square with a red circle at its center, drawn using LAB color mode.');
958
841
  * }
959
- * </code>
960
- * </div>
961
842
  *
962
843
  * @example
963
- * <div>
964
- * <code>
965
844
  * function setup() {
966
845
  * createCanvas(100, 100);
967
846
  *
@@ -981,12 +860,8 @@ function setting(p5, fn){
981
860
  *
982
861
  * describe('A gray square with a red circle at its center, drawn using LCH color mode.');
983
862
  * }
984
- * </code>
985
- * </div>
986
863
  *
987
864
  * @example
988
- * <div>
989
- * <code>
990
865
  * function setup() {
991
866
  * createCanvas(100, 100);
992
867
  *
@@ -1004,11 +879,8 @@ function setting(p5, fn){
1004
879
  * 'A diagonal green to red gradient from bottom-left to top-right with shading transitioning to black at top-left corner.'
1005
880
  * );
1006
881
  * }
1007
- * </code>
1008
- * </div>
1009
882
  *
1010
- * <div>
1011
- * <code>
883
+ * @example
1012
884
  * function setup() {
1013
885
  * createCanvas(100, 100);
1014
886
  *
@@ -1024,11 +896,8 @@ function setting(p5, fn){
1024
896
  *
1025
897
  * describe('A rainbow gradient from left-to-right. Brightness transitions to white at the top.');
1026
898
  * }
1027
- * </code>
1028
- * </div>
1029
899
  *
1030
- * <div>
1031
- * <code>
900
+ * @example
1032
901
  * function setup() {
1033
902
  * createCanvas(100, 100);
1034
903
  *
@@ -1056,11 +925,8 @@ function setting(p5, fn){
1056
925
  *
1057
926
  * describe('A purple canvas with the red, green, and blue decimal values of the color written on it.');
1058
927
  * }
1059
- * </code>
1060
- * </div>
1061
928
  *
1062
- * <div>
1063
- * <code>
929
+ * @example
1064
930
  * function setup() {
1065
931
  * createCanvas(100, 100);
1066
932
  *
@@ -1077,12 +943,8 @@ function setting(p5, fn){
1077
943
  *
1078
944
  * describe('Two overlapping translucent pink circle outlines.');
1079
945
  * }
1080
- * </code>
1081
- * </div>
1082
946
  *
1083
947
  * @example
1084
- * <div>
1085
- * <code>
1086
948
  * let hslGraphic, lchGraphic, oklchGraphic;
1087
949
  *
1088
950
  * function setup() {
@@ -1132,12 +994,8 @@ function setting(p5, fn){
1132
994
  * image(lchGraphic, 200, 0);
1133
995
  * image(oklchGraphic, 400, 0);
1134
996
  * }
1135
- * </code>
1136
- * </div>
1137
997
  *
1138
998
  * @example
1139
- * <div>
1140
- * <code>
1141
999
  * // Example: Single-value (Grayscale) colors in different color modes.
1142
1000
  * // The rectangle is filled with one parameter, but its final color depends
1143
1001
  * // on how that parameter is interpreted by the current color mode.
@@ -1161,8 +1019,6 @@ function setting(p5, fn){
1161
1019
  * textSize(14);
1162
1020
  * text("RGB (128)", 10, 20);
1163
1021
  * }
1164
- * </code>
1165
- * </div>
1166
1022
  */
1167
1023
  /**
1168
1024
  * @method colorMode
@@ -1250,8 +1106,6 @@ function setting(p5, fn){
1250
1106
  * @param {Number} [alpha] alpha value, controls transparency (0 - transparent, 255 - opaque).
1251
1107
  * @chainable
1252
1108
  * @example
1253
- * <div>
1254
- * <code>
1255
1109
  * function setup() {
1256
1110
  * createCanvas(100, 100);
1257
1111
  *
@@ -1263,11 +1117,8 @@ function setting(p5, fn){
1263
1117
  *
1264
1118
  * describe('A dark charcoal gray square with a black outline.');
1265
1119
  * }
1266
- * </code>
1267
- * </div>
1268
1120
  *
1269
- * <div>
1270
- * <code>
1121
+ * @example
1271
1122
  * function setup() {
1272
1123
  * createCanvas(100, 100);
1273
1124
  *
@@ -1279,11 +1130,8 @@ function setting(p5, fn){
1279
1130
  *
1280
1131
  * describe('A yellow square with a black outline.');
1281
1132
  * }
1282
- * </code>
1283
- * </div>
1284
1133
  *
1285
- * <div>
1286
- * <code>
1134
+ * @example
1287
1135
  * function setup() {
1288
1136
  * createCanvas(100, 100);
1289
1137
  *
@@ -1295,11 +1143,8 @@ function setting(p5, fn){
1295
1143
  *
1296
1144
  * describe('A semi-transparent red square with a black outline.');
1297
1145
  * }
1298
- * </code>
1299
- * </div>
1300
1146
  *
1301
- * <div>
1302
- * <code>
1147
+ * @example
1303
1148
  * function setup() {
1304
1149
  * createCanvas(100, 100);
1305
1150
  *
@@ -1314,11 +1159,8 @@ function setting(p5, fn){
1314
1159
  *
1315
1160
  * describe('A royal blue square with a black outline.');
1316
1161
  * }
1317
- * </code>
1318
- * </div>
1319
1162
  *
1320
- * <div>
1321
- * <code>
1163
+ * @example
1322
1164
  * function setup() {
1323
1165
  * createCanvas(100, 100);
1324
1166
  *
@@ -1330,11 +1172,8 @@ function setting(p5, fn){
1330
1172
  *
1331
1173
  * describe('A red square with a black outline.');
1332
1174
  * }
1333
- * </code>
1334
- * </div>
1335
1175
  *
1336
- * <div>
1337
- * <code>
1176
+ * @example
1338
1177
  * function setup() {
1339
1178
  * createCanvas(100, 100);
1340
1179
  *
@@ -1346,11 +1185,8 @@ function setting(p5, fn){
1346
1185
  *
1347
1186
  * describe('A pink square with a black outline.');
1348
1187
  * }
1349
- * </code>
1350
- * </div>
1351
1188
  *
1352
- * <div>
1353
- * <code>
1189
+ * @example
1354
1190
  * function setup() {
1355
1191
  * createCanvas(100, 100);
1356
1192
  *
@@ -1362,11 +1198,8 @@ function setting(p5, fn){
1362
1198
  *
1363
1199
  * describe('A purple square with a black outline.');
1364
1200
  * }
1365
- * </code>
1366
- * </div>
1367
1201
  *
1368
- * <div>
1369
- * <code>
1202
+ * @example
1370
1203
  * function setup() {
1371
1204
  * createCanvas(100, 100);
1372
1205
  *
@@ -1378,11 +1211,8 @@ function setting(p5, fn){
1378
1211
  *
1379
1212
  * describe('A bright green square with a black outline.');
1380
1213
  * }
1381
- * </code>
1382
- * </div>
1383
1214
  *
1384
- * <div>
1385
- * <code>
1215
+ * @example
1386
1216
  * function setup() {
1387
1217
  * createCanvas(100, 100);
1388
1218
  *
@@ -1394,11 +1224,8 @@ function setting(p5, fn){
1394
1224
  *
1395
1225
  * describe('A soft green rectange with a black outline.');
1396
1226
  * }
1397
- * </code>
1398
- * </div>
1399
1227
  *
1400
- * <div>
1401
- * <code>
1228
+ * @example
1402
1229
  * function setup() {
1403
1230
  * createCanvas(100, 100);
1404
1231
  *
@@ -1410,11 +1237,8 @@ function setting(p5, fn){
1410
1237
  *
1411
1238
  * describe('A red square with a black outline.');
1412
1239
  * }
1413
- * </code>
1414
- * </div>
1415
1240
  *
1416
- * <div>
1417
- * <code>
1241
+ * @example
1418
1242
  * function setup() {
1419
1243
  * createCanvas(100, 100);
1420
1244
  *
@@ -1426,11 +1250,8 @@ function setting(p5, fn){
1426
1250
  *
1427
1251
  * describe('A dark fuchsia square with a black outline.');
1428
1252
  * }
1429
- * </code>
1430
- * </div>
1431
1253
  *
1432
- * <div>
1433
- * <code>
1254
+ * @example
1434
1255
  * function setup() {
1435
1256
  * createCanvas(100, 100);
1436
1257
  *
@@ -1443,30 +1264,24 @@ function setting(p5, fn){
1443
1264
  *
1444
1265
  * describe('A blue square with a black outline.');
1445
1266
  * }
1446
- * </code>
1447
- * </div>
1448
1267
  */
1449
-
1450
1268
  /**
1451
1269
  * @method fill
1452
1270
  * @param {String} value a color string.
1453
1271
  * @chainable
1454
1272
  */
1455
-
1456
1273
  /**
1457
1274
  * @method fill
1458
1275
  * @param {Number} gray a grayscale value.
1459
1276
  * @param {Number} [alpha]
1460
1277
  * @chainable
1461
1278
  */
1462
-
1463
1279
  /**
1464
1280
  * @method fill
1465
1281
  * @param {Number[]} values an array containing the red, green, blue &
1466
1282
  * and alpha components of the color.
1467
1283
  * @chainable
1468
1284
  */
1469
-
1470
1285
  /**
1471
1286
  * @method fill
1472
1287
  * @param {p5.Color} color the fill color.
@@ -1488,8 +1303,6 @@ function setting(p5, fn){
1488
1303
  * @chainable
1489
1304
  *
1490
1305
  * @example
1491
- * <div>
1492
- * <code>
1493
1306
  * function setup() {
1494
1307
  * createCanvas(100, 100);
1495
1308
  *
@@ -1504,11 +1317,8 @@ function setting(p5, fn){
1504
1317
  *
1505
1318
  * describe('A white square on above an empty square. Both squares have black outlines.');
1506
1319
  * }
1507
- * </code>
1508
- * </div>
1509
1320
  *
1510
- * <div modernizr='webgl'>
1511
- * <code>
1321
+ * @example
1512
1322
  * function setup() {
1513
1323
  * createCanvas(100, 100, WEBGL);
1514
1324
  *
@@ -1529,8 +1339,6 @@ function setting(p5, fn){
1529
1339
  * // Draw the box.
1530
1340
  * box(45);
1531
1341
  * }
1532
- * </code>
1533
- * </div>
1534
1342
  */
1535
1343
  fn.noFill = function() {
1536
1344
  this._renderer.noFill();
@@ -1548,8 +1356,6 @@ function setting(p5, fn){
1548
1356
  * @method noStroke
1549
1357
  * @chainable
1550
1358
  * @example
1551
- * <div>
1552
- * <code>
1553
1359
  * function setup() {
1554
1360
  * createCanvas(100, 100);
1555
1361
  *
@@ -1560,11 +1366,8 @@ function setting(p5, fn){
1560
1366
  *
1561
1367
  * describe('A white square with no outline.');
1562
1368
  * }
1563
- * </code>
1564
- * </div>
1565
1369
  *
1566
- * <div modernizr='webgl'>
1567
- * <code>
1370
+ * @example
1568
1371
  * function setup() {
1569
1372
  * createCanvas(100, 100, WEBGL);
1570
1373
  *
@@ -1585,8 +1388,6 @@ function setting(p5, fn){
1585
1388
  * // Draw the box.
1586
1389
  * box(45);
1587
1390
  * }
1588
- * </code>
1589
- * </div>
1590
1391
  */
1591
1392
  fn.noStroke = function() {
1592
1393
  this._renderer.states.setValue('strokeColor', null);
@@ -1625,8 +1426,6 @@ function setting(p5, fn){
1625
1426
  * @chainable
1626
1427
  *
1627
1428
  * @example
1628
- * <div>
1629
- * <code>
1630
1429
  * function setup() {
1631
1430
  * createCanvas(100, 100);
1632
1431
  *
@@ -1639,11 +1438,8 @@ function setting(p5, fn){
1639
1438
  *
1640
1439
  * describe('A white square with a dark charcoal gray outline.');
1641
1440
  * }
1642
- * </code>
1643
- * </div>
1644
1441
  *
1645
- * <div>
1646
- * <code>
1442
+ * @example
1647
1443
  * function setup() {
1648
1444
  * createCanvas(100, 100);
1649
1445
  *
@@ -1656,11 +1452,8 @@ function setting(p5, fn){
1656
1452
  *
1657
1453
  * describe('A white square with a yellow outline.');
1658
1454
  * }
1659
- * </code>
1660
- * </div>
1661
1455
  *
1662
- * <div>
1663
- * <code>
1456
+ * @example
1664
1457
  * function setup() {
1665
1458
  * createCanvas(100, 100);
1666
1459
  *
@@ -1676,11 +1469,8 @@ function setting(p5, fn){
1676
1469
  *
1677
1470
  * describe('A white square with a royal blue outline.');
1678
1471
  * }
1679
- * </code>
1680
- * </div>
1681
1472
  *
1682
- * <div>
1683
- * <code>
1473
+ * @example
1684
1474
  * function setup() {
1685
1475
  * createCanvas(100, 100);
1686
1476
  *
@@ -1693,11 +1483,8 @@ function setting(p5, fn){
1693
1483
  *
1694
1484
  * describe('A white square with a red outline.');
1695
1485
  * }
1696
- * </code>
1697
- * </div>
1698
1486
  *
1699
- * <div>
1700
- * <code>
1487
+ * @example
1701
1488
  * function setup() {
1702
1489
  * createCanvas(100, 100);
1703
1490
  *
@@ -1710,11 +1497,8 @@ function setting(p5, fn){
1710
1497
  *
1711
1498
  * describe('A white square with a pink outline.');
1712
1499
  * }
1713
- * </code>
1714
- * </div>
1715
1500
  *
1716
- * <div>
1717
- * <code>
1501
+ * @example
1718
1502
  * function setup() {
1719
1503
  * createCanvas(100, 100);
1720
1504
  *
@@ -1727,11 +1511,8 @@ function setting(p5, fn){
1727
1511
  *
1728
1512
  * describe('A white square with a black outline.');
1729
1513
  * }
1730
- * </code>
1731
- * </div>
1732
1514
  *
1733
- * <div>
1734
- * <code>
1515
+ * @example
1735
1516
  * function setup() {
1736
1517
  * createCanvas(100, 100);
1737
1518
  *
@@ -1744,11 +1525,8 @@ function setting(p5, fn){
1744
1525
  *
1745
1526
  * describe('A white square with a bright green outline.');
1746
1527
  * }
1747
- * </code>
1748
- * </div>
1749
1528
  *
1750
- * <div>
1751
- * <code>
1529
+ * @example
1752
1530
  * function setup() {
1753
1531
  * createCanvas(100, 100);
1754
1532
  *
@@ -1761,11 +1539,8 @@ function setting(p5, fn){
1761
1539
  *
1762
1540
  * describe('A white square with a soft green outline.');
1763
1541
  * }
1764
- * </code>
1765
- * </div>
1766
1542
  *
1767
- * <div>
1768
- * <code>
1543
+ * @example
1769
1544
  * function setup() {
1770
1545
  * createCanvas(100, 100);
1771
1546
  *
@@ -1778,11 +1553,8 @@ function setting(p5, fn){
1778
1553
  *
1779
1554
  * describe('A white square with a red outline.');
1780
1555
  * }
1781
- * </code>
1782
- * </div>
1783
1556
  *
1784
- * <div>
1785
- * <code>
1557
+ * @example
1786
1558
  * function setup() {
1787
1559
  * createCanvas(100, 100);
1788
1560
  *
@@ -1795,11 +1567,8 @@ function setting(p5, fn){
1795
1567
  *
1796
1568
  * describe('A white square with a dark fuchsia outline.');
1797
1569
  * }
1798
- * </code>
1799
- * </div>
1800
1570
  *
1801
- * <div>
1802
- * <code>
1571
+ * @example
1803
1572
  * function setup() {
1804
1573
  * createCanvas(100, 100);
1805
1574
  *
@@ -1812,30 +1581,24 @@ function setting(p5, fn){
1812
1581
  *
1813
1582
  * describe('A white square with a blue outline.');
1814
1583
  * }
1815
- * </code>
1816
- * </div>
1817
1584
  */
1818
-
1819
1585
  /**
1820
1586
  * @method stroke
1821
1587
  * @param {String} value a color string.
1822
1588
  * @chainable
1823
1589
  */
1824
-
1825
1590
  /**
1826
1591
  * @method stroke
1827
1592
  * @param {Number} gray a grayscale value.
1828
1593
  * @param {Number} [alpha]
1829
1594
  * @chainable
1830
1595
  */
1831
-
1832
1596
  /**
1833
1597
  * @method stroke
1834
1598
  * @param {Number[]} values an array containing the red, green, blue,
1835
1599
  * and alpha components of the color.
1836
1600
  * @chainable
1837
1601
  */
1838
-
1839
1602
  /**
1840
1603
  * @method stroke
1841
1604
  * @param {p5.Color} color the stroke color.
@@ -1883,8 +1646,6 @@ function setting(p5, fn){
1883
1646
  * @chainable
1884
1647
  *
1885
1648
  * @example
1886
- * <div>
1887
- * <code>
1888
1649
  * function setup() {
1889
1650
  * createCanvas(100, 100);
1890
1651
  *
@@ -1901,12 +1662,8 @@ function setting(p5, fn){
1901
1662
  *
1902
1663
  * describe('A purple canvas with a pink square in the middle. A circle is erased from the top-left, leaving a hole.');
1903
1664
  * }
1904
- * </code>
1905
- * </div>
1906
1665
  *
1907
1666
  * @example
1908
- * <div>
1909
- * <code>
1910
1667
  * function setup() {
1911
1668
  * createCanvas(100, 100);
1912
1669
  *
@@ -1924,8 +1681,6 @@ function setting(p5, fn){
1924
1681
  *
1925
1682
  * describe('A purple canvas with a pink square in the middle. A circle at the top-left partially erases its interior and a fully erases its outline.');
1926
1683
  * }
1927
- * </code>
1928
- * </div>
1929
1684
  */
1930
1685
  fn.erase = function(opacityFill = 255, opacityStroke = 255) {
1931
1686
  this._renderer.erase(opacityFill, opacityStroke);
@@ -1943,8 +1698,6 @@ function setting(p5, fn){
1943
1698
  * @method noErase
1944
1699
  * @chainable
1945
1700
  * @example
1946
- * <div>
1947
- * <code>
1948
1701
  * function setup() {
1949
1702
  * createCanvas(100, 100);
1950
1703
  *
@@ -1965,8 +1718,6 @@ function setting(p5, fn){
1965
1718
  *
1966
1719
  * describe('An orange canvas with two tall blue rectangles. A circular hole in the center erases the rectangle on the left but not the one on the right.');
1967
1720
  * }
1968
- * </code>
1969
- * </div>
1970
1721
  */
1971
1722
  fn.noErase = function() {
1972
1723
  this._renderer.noErase();
@@ -2021,8 +1772,6 @@ function setting(p5, fn){
2021
1772
  * SOFT_LIGHT, DODGE, BURN, ADD, REMOVE or SUBTRACT
2022
1773
  *
2023
1774
  * @example
2024
- * <div>
2025
- * <code>
2026
1775
  * function setup() {
2027
1776
  * createCanvas(100, 100);
2028
1777
  *
@@ -2044,11 +1793,8 @@ function setting(p5, fn){
2044
1793
  *
2045
1794
  * describe('A blue line and a red line form an X on a gray background.');
2046
1795
  * }
2047
- * </code>
2048
- * </div>
2049
1796
  *
2050
- * <div>
2051
- * <code>
1797
+ * @example
2052
1798
  * function setup() {
2053
1799
  * createCanvas(100, 100);
2054
1800
  *
@@ -2070,11 +1816,8 @@ function setting(p5, fn){
2070
1816
  *
2071
1817
  * describe('A faint blue line and a faint red line form an X on a gray background. The area where they overlap is faint magenta.');
2072
1818
  * }
2073
- * </code>
2074
- * </div>
2075
1819
  *
2076
- * <div>
2077
- * <code>
1820
+ * @example
2078
1821
  * function setup() {
2079
1822
  * createCanvas(100, 100);
2080
1823
  *
@@ -2096,11 +1839,8 @@ function setting(p5, fn){
2096
1839
  *
2097
1840
  * describe('A blue line and a red line form an X on a gray background. The area where they overlap is black.');
2098
1841
  * }
2099
- * </code>
2100
- * </div>
2101
1842
  *
2102
- * <div>
2103
- * <code>
1843
+ * @example
2104
1844
  * function setup() {
2105
1845
  * createCanvas(100, 100);
2106
1846
  *
@@ -2122,11 +1862,8 @@ function setting(p5, fn){
2122
1862
  *
2123
1863
  * describe('A faint blue line and a faint red line form an X on a gray background. The area where they overlap is faint magenta.');
2124
1864
  * }
2125
- * </code>
2126
- * </div>
2127
1865
  *
2128
- * <div>
2129
- * <code>
1866
+ * @example
2130
1867
  * function setup() {
2131
1868
  * createCanvas(100, 100);
2132
1869
  *
@@ -2148,11 +1885,8 @@ function setting(p5, fn){
2148
1885
  *
2149
1886
  * describe('A yellow line and a cyan line form an X on a gray background. The area where they overlap is green.');
2150
1887
  * }
2151
- * </code>
2152
- * </div>
2153
1888
  *
2154
- * <div>
2155
- * <code>
1889
+ * @example
2156
1890
  * function setup() {
2157
1891
  * createCanvas(100, 100);
2158
1892
  *
@@ -2174,11 +1908,8 @@ function setting(p5, fn){
2174
1908
  *
2175
1909
  * describe('A blue line and a red line form an X on a gray background. The area where they overlap is black.');
2176
1910
  * }
2177
- * </code>
2178
- * </div>
2179
1911
  *
2180
- * <div>
2181
- * <code>
1912
+ * @example
2182
1913
  * function setup() {
2183
1914
  * createCanvas(100, 100);
2184
1915
  *
@@ -2200,11 +1931,8 @@ function setting(p5, fn){
2200
1931
  *
2201
1932
  * describe('A faint blue line and a faint red line form an X on a gray background. The area where they overlap is faint magenta.');
2202
1933
  * }
2203
- * </code>
2204
- * </div>
2205
1934
  *
2206
- * <div>
2207
- * <code>
1935
+ * @example
2208
1936
  * function setup() {
2209
1937
  * createCanvas(100, 100);
2210
1938
  *
@@ -2226,11 +1954,8 @@ function setting(p5, fn){
2226
1954
  *
2227
1955
  * describe('A diagonal red line.');
2228
1956
  * }
2229
- * </code>
2230
- * </div>
2231
1957
  *
2232
- * <div>
2233
- * <code>
1958
+ * @example
2234
1959
  * function setup() {
2235
1960
  * createCanvas(100, 100);
2236
1961
  *
@@ -2252,11 +1977,8 @@ function setting(p5, fn){
2252
1977
  *
2253
1978
  * describe('The silhouette of an X is missing from a gray background.');
2254
1979
  * }
2255
- * </code>
2256
- * </div>
2257
1980
  *
2258
- * <div>
2259
- * <code>
1981
+ * @example
2260
1982
  * function setup() {
2261
1983
  * createCanvas(100, 100);
2262
1984
  *
@@ -2278,11 +2000,8 @@ function setting(p5, fn){
2278
2000
  *
2279
2001
  * describe('A yellow line and a cyan line form an X on a gray background. The area where they overlap is green.');
2280
2002
  * }
2281
- * </code>
2282
- * </div>
2283
2003
  *
2284
- * <div>
2285
- * <code>
2004
+ * @example
2286
2005
  * function setup() {
2287
2006
  * createCanvas(100, 100);
2288
2007
  *
@@ -2304,11 +2023,8 @@ function setting(p5, fn){
2304
2023
  *
2305
2024
  * describe('A faint blue line and a faint red line form an X on a gray background. The area where they overlap is bright magenta.');
2306
2025
  * }
2307
- * </code>
2308
- * </div>
2309
2026
  *
2310
- * <div>
2311
- * <code>
2027
+ * @example
2312
2028
  * function setup() {
2313
2029
  * createCanvas(100, 100);
2314
2030
  *
@@ -2330,11 +2046,8 @@ function setting(p5, fn){
2330
2046
  *
2331
2047
  * describe('A blue line and a red line form an X on a gray background.');
2332
2048
  * }
2333
- * </code>
2334
- * </div>
2335
2049
  *
2336
- * <div>
2337
- * <code>
2050
+ * @example
2338
2051
  * function setup() {
2339
2052
  * createCanvas(100, 100);
2340
2053
  *
@@ -2356,11 +2069,8 @@ function setting(p5, fn){
2356
2069
  *
2357
2070
  * describe('A faint blue line and a faint red line form an X on a gray background. The area where they overlap is violet.');
2358
2071
  * }
2359
- * </code>
2360
- * </div>
2361
2072
  *
2362
- * <div>
2363
- * <code>
2073
+ * @example
2364
2074
  * function setup() {
2365
2075
  * createCanvas(100, 100);
2366
2076
  *
@@ -2382,11 +2092,8 @@ function setting(p5, fn){
2382
2092
  *
2383
2093
  * describe('A faint blue line and a faint red line form an X on a gray background. The area where they overlap is faint violet.');
2384
2094
  * }
2385
- * </code>
2386
- * </div>
2387
2095
  *
2388
- * <div>
2389
- * <code>
2096
+ * @example
2390
2097
  * function setup() {
2391
2098
  * createCanvas(100, 100);
2392
2099
  *
@@ -2408,11 +2115,8 @@ function setting(p5, fn){
2408
2115
  *
2409
2116
  * describe('A blue line and a red line form an X on a gray background. The area where they overlap is black.');
2410
2117
  * }
2411
- * </code>
2412
- * </div>
2413
2118
  *
2414
- * <div>
2415
- * <code>
2119
+ * @example
2416
2120
  * function setup() {
2417
2121
  * createCanvas(100, 100);
2418
2122
  *
@@ -2434,8 +2138,6 @@ function setting(p5, fn){
2434
2138
  *
2435
2139
  * describe('A yellow line and a turquoise line form an X on a gray background. The area where they overlap is green.');
2436
2140
  * }
2437
- * </code>
2438
- * </div>
2439
2141
  */
2440
2142
  fn.blendMode = function (mode) {
2441
2143
  // p5._validateParameters('blendMode', arguments);