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
@@ -319,8 +319,6 @@ class Color {
319
319
  * @return {String} the formatted string.
320
320
  *
321
321
  * @example
322
- * <div>
323
- * <code>
324
322
  * function setup() {
325
323
  * createCanvas(100, 100);
326
324
  *
@@ -338,8 +336,6 @@ class Color {
338
336
  *
339
337
  * describe('The text "#9932cc" written in purple on a gray background.');
340
338
  * }
341
- * </code>
342
- * </div>
343
339
  */
344
340
  toString(format) {
345
341
  if (format === undefined && this._defaultStringValue !== undefined) {
@@ -400,8 +396,6 @@ class Color {
400
396
  * @param {Color} other
401
397
  * @returns {boolean|object}
402
398
  * @example
403
- * <div>
404
- * <code>
405
399
  * let bgColor, fg1Color, fg2Color, msg1, msg2;
406
400
  * function setup() {
407
401
  * createCanvas(100, 100);
@@ -435,11 +429,8 @@ class Color {
435
429
  * fill(fg2Color);
436
430
  * text(msg2, 10, 60);
437
431
  * }
438
- * </code>
439
- * </div>
440
432
  *
441
- * <div>
442
- * <code>
433
+ * @example
443
434
  * let bgColor, fgColor, contrast;
444
435
  * function setup() {
445
436
  * createCanvas(100, 100);
@@ -462,8 +453,6 @@ class Color {
462
453
  * text('APCA', 10, 70);
463
454
  * text(nf(contrast.APCA.value, 0, 2), 10, 85);
464
455
  * }
465
- * </code>
466
- * </div>
467
456
  */
468
457
  contrast(other_color, options='WCAG21') {
469
458
  if(options !== 'all'){
@@ -508,8 +497,6 @@ class Color {
508
497
  * @param {Number} red the new red value.
509
498
  *
510
499
  * @example
511
- * <div>
512
- * <code>
513
500
  * function setup() {
514
501
  * createCanvas(100, 100);
515
502
  *
@@ -532,8 +519,6 @@ class Color {
532
519
  *
533
520
  * describe('Two rectangles. The left one is salmon pink and the right one is teal.');
534
521
  * }
535
- * </code>
536
- * </div>
537
522
  */
538
523
  setRed(new_red, max=[0, 1]) {
539
524
  this._defaultStringValue = undefined;
@@ -564,8 +549,6 @@ class Color {
564
549
  * @param {Number} green the new green value.
565
550
  *
566
551
  * @example
567
- * <div>
568
- * <code>
569
552
  * function setup() {
570
553
  * createCanvas(100, 100);
571
554
  *
@@ -588,8 +571,6 @@ class Color {
588
571
  *
589
572
  * describe('Two rectangles. The left one is salmon pink and the right one is yellow.');
590
573
  * }
591
- * </code>
592
- * </div>
593
574
  */
594
575
  setGreen(new_green, max=[0, 1]) {
595
576
  this._defaultStringValue = undefined;
@@ -620,8 +601,6 @@ class Color {
620
601
  * @param {Number} blue the new blue value.
621
602
  *
622
603
  * @example
623
- * <div>
624
- * <code>
625
604
  * function setup() {
626
605
  * createCanvas(100, 100);
627
606
  *
@@ -644,8 +623,6 @@ class Color {
644
623
  *
645
624
  * describe('Two rectangles. The left one is salmon pink and the right one is pale fuchsia.');
646
625
  * }
647
- * </code>
648
- * </div>
649
626
  */
650
627
  setBlue(new_blue, max=[0, 1]) {
651
628
  this._defaultStringValue = undefined;
@@ -677,8 +654,6 @@ class Color {
677
654
  * @param {Number} alpha the new alpha value.
678
655
  *
679
656
  * @example
680
- * <div>
681
- * <code>
682
657
  * function setup() {
683
658
  * createCanvas(100, 100);
684
659
  *
@@ -701,8 +676,6 @@ class Color {
701
676
  *
702
677
  * describe('Two rectangles. The left one is salmon pink and the right one is faded pink.');
703
678
  * }
704
- * </code>
705
- * </div>
706
679
  */
707
680
  setAlpha(new_alpha, max=[0, 1]) {
708
681
  this._defaultStringValue = undefined;
@@ -1256,8 +1229,6 @@ function creatingReading(p5, fn){
1256
1229
  * @return {p5.Color} resulting color.
1257
1230
  *
1258
1231
  * @example
1259
- * <div>
1260
- * <code>
1261
1232
  * function setup() {
1262
1233
  * createCanvas(100, 100);
1263
1234
  *
@@ -1273,12 +1244,8 @@ function creatingReading(p5, fn){
1273
1244
  *
1274
1245
  * describe('A yellow square on a gray canvas.');
1275
1246
  * }
1276
- * </code>
1277
- * </div>
1278
1247
  *
1279
1248
  * @example
1280
- * <div>
1281
- * <code>
1282
1249
  * function setup() {
1283
1250
  * createCanvas(100, 100);
1284
1251
  *
@@ -1303,12 +1270,8 @@ function creatingReading(p5, fn){
1303
1270
  * 'Two circles on a gray canvas. The circle in the top-left corner is yellow and the one at the bottom-right is gray.'
1304
1271
  * );
1305
1272
  * }
1306
- * </code>
1307
- * </div>
1308
1273
  *
1309
1274
  * @example
1310
- * <div>
1311
- * <code>
1312
1275
  * function setup() {
1313
1276
  * createCanvas(100, 100);
1314
1277
  *
@@ -1324,12 +1287,8 @@ function creatingReading(p5, fn){
1324
1287
  *
1325
1288
  * describe('A magenta square on a gray canvas.');
1326
1289
  * }
1327
- * </code>
1328
- * </div>
1329
1290
  *
1330
1291
  * @example
1331
- * <div>
1332
- * <code>
1333
1292
  * function setup() {
1334
1293
  * createCanvas(100, 100);
1335
1294
  *
@@ -1352,12 +1311,8 @@ function creatingReading(p5, fn){
1352
1311
  *
1353
1312
  * describe('Two bright green rectangles on a gray canvas.');
1354
1313
  * }
1355
- * </code>
1356
- * </div>
1357
1314
  *
1358
1315
  * @example
1359
- * <div>
1360
- * <code>
1361
1316
  * function setup() {
1362
1317
  * createCanvas(100, 100);
1363
1318
  *
@@ -1393,12 +1348,8 @@ function creatingReading(p5, fn){
1393
1348
  *
1394
1349
  * describe('Four blue squares in the corners of a gray canvas.');
1395
1350
  * }
1396
- * </code>
1397
- * </div>
1398
1351
  *
1399
1352
  * @example
1400
- * <div>
1401
- * <code>
1402
1353
  * function setup() {
1403
1354
  * createCanvas(100, 100);
1404
1355
  *
@@ -1421,11 +1372,8 @@ function creatingReading(p5, fn){
1421
1372
  *
1422
1373
  * describe('Two sea green rectangles. A darker rectangle on the left and a brighter one on the right.');
1423
1374
  * }
1424
- * </code>
1425
- * </div>
1426
1375
  *
1427
- * <div>
1428
- * <code>
1376
+ * @example
1429
1377
  * function setup() {
1430
1378
  * createCanvas(100, 100);
1431
1379
  *
@@ -1448,11 +1396,8 @@ function creatingReading(p5, fn){
1448
1396
  *
1449
1397
  * describe('Two green rectangles. A darker rectangle on the left and a brighter one on the right.');
1450
1398
  * }
1451
- * </code>
1452
- * </div>
1453
1399
  *
1454
- * <div>
1455
- * <code>
1400
+ * @example
1456
1401
  * function setup() {
1457
1402
  * createCanvas(100, 100);
1458
1403
  *
@@ -1477,10 +1422,7 @@ function creatingReading(p5, fn){
1477
1422
  *
1478
1423
  * describe('Two blue rectangles. A darker rectangle on the left and a brighter one on the right.');
1479
1424
  * }
1480
- * </code>
1481
- * </div>
1482
1425
  */
1483
-
1484
1426
  /**
1485
1427
  * @method color
1486
1428
  * @param {Number} v1 red or hue value relative to
@@ -1492,20 +1434,17 @@ function creatingReading(p5, fn){
1492
1434
  * @param {Number} [alpha]
1493
1435
  * @return {p5.Color}
1494
1436
  */
1495
-
1496
1437
  /**
1497
1438
  * @method color
1498
1439
  * @param {String} value a color string.
1499
1440
  * @return {p5.Color}
1500
1441
  */
1501
-
1502
1442
  /**
1503
1443
  * @method color
1504
1444
  * @param {Number[]} values an array containing the red, green, blue,
1505
1445
  * and alpha components of the color.
1506
1446
  * @return {p5.Color}
1507
1447
  */
1508
-
1509
1448
  /**
1510
1449
  * @method color
1511
1450
  * @param {p5.Color} color
@@ -1544,8 +1483,6 @@ function creatingReading(p5, fn){
1544
1483
  * @return {Number} the red value.
1545
1484
  *
1546
1485
  * @example
1547
- * <div>
1548
- * <code>
1549
1486
  * function setup() {
1550
1487
  * createCanvas(100, 100);
1551
1488
  *
@@ -1568,12 +1505,8 @@ function creatingReading(p5, fn){
1568
1505
  *
1569
1506
  * describe('Two rectangles. The left one is light purple and the right one is red.');
1570
1507
  * }
1571
- * </code>
1572
- * </div>
1573
1508
  *
1574
1509
  * @example
1575
- * <div>
1576
- * <code>
1577
1510
  * function setup() {
1578
1511
  * createCanvas(100, 100);
1579
1512
  *
@@ -1596,12 +1529,8 @@ function creatingReading(p5, fn){
1596
1529
  *
1597
1530
  * describe('Two rectangles. The left one is light purple and the right one is red.');
1598
1531
  * }
1599
- * </code>
1600
- * </div>
1601
1532
  *
1602
1533
  * @example
1603
- * <div>
1604
- * <code>
1605
1534
  * function setup() {
1606
1535
  * createCanvas(100, 100);
1607
1536
  *
@@ -1624,12 +1553,8 @@ function creatingReading(p5, fn){
1624
1553
  *
1625
1554
  * describe('Two rectangles. The left one is light purple and the right one is red.');
1626
1555
  * }
1627
- * </code>
1628
- * </div>
1629
1556
  *
1630
1557
  * @example
1631
- * <div>
1632
- * <code>
1633
1558
  * function setup() {
1634
1559
  * createCanvas(100, 100);
1635
1560
  *
@@ -1655,8 +1580,6 @@ function creatingReading(p5, fn){
1655
1580
  *
1656
1581
  * describe('Two rectangles. The left one is light purple and the right one is red.');
1657
1582
  * }
1658
- * </code>
1659
- * </div>
1660
1583
  */
1661
1584
  fn.red = function(c) {
1662
1585
  // p5._validateParameters('red', arguments);
@@ -1681,8 +1604,6 @@ function creatingReading(p5, fn){
1681
1604
  * @return {Number} the green value.
1682
1605
  *
1683
1606
  * @example
1684
- * <div>
1685
- * <code>
1686
1607
  * function setup() {
1687
1608
  * createCanvas(100, 100);
1688
1609
  *
@@ -1705,12 +1626,8 @@ function creatingReading(p5, fn){
1705
1626
  *
1706
1627
  * describe('Two rectangles. The left one is light purple and the right one is dark green.');
1707
1628
  * }
1708
- * </code>
1709
- * </div>
1710
1629
  *
1711
1630
  * @example
1712
- * <div>
1713
- * <code>
1714
1631
  * function setup() {
1715
1632
  * createCanvas(100, 100);
1716
1633
  *
@@ -1733,12 +1650,8 @@ function creatingReading(p5, fn){
1733
1650
  *
1734
1651
  * describe('Two rectangles. The left one is light purple and the right one is dark green.');
1735
1652
  * }
1736
- * </code>
1737
- * </div>
1738
1653
  *
1739
1654
  * @example
1740
- * <div>
1741
- * <code>
1742
1655
  * function setup() {
1743
1656
  * createCanvas(100, 100);
1744
1657
  *
@@ -1761,12 +1674,8 @@ function creatingReading(p5, fn){
1761
1674
  *
1762
1675
  * describe('Two rectangles. The left one is light purple and the right one is dark green.');
1763
1676
  * }
1764
- * </code>
1765
- * </div>
1766
1677
  *
1767
1678
  * @example
1768
- * <div>
1769
- * <code>
1770
1679
  * function setup() {
1771
1680
  * createCanvas(100, 100);
1772
1681
  *
@@ -1792,8 +1701,6 @@ function creatingReading(p5, fn){
1792
1701
  *
1793
1702
  * describe('Two rectangles. The left one is light purple and the right one is dark green.');
1794
1703
  * }
1795
- * </code>
1796
- * </div>
1797
1704
  */
1798
1705
  fn.green = function(c) {
1799
1706
  // p5._validateParameters('green', arguments);
@@ -1818,8 +1725,6 @@ function creatingReading(p5, fn){
1818
1725
  * @return {Number} the blue value.
1819
1726
  *
1820
1727
  * @example
1821
- * <div>
1822
- * <code>
1823
1728
  * function setup() {
1824
1729
  * createCanvas(100, 100);
1825
1730
  *
@@ -1842,12 +1747,8 @@ function creatingReading(p5, fn){
1842
1747
  *
1843
1748
  * describe('Two rectangles. The left one is light purple and the right one is royal blue.');
1844
1749
  * }
1845
- * </code>
1846
- * </div>
1847
1750
  *
1848
1751
  * @example
1849
- * <div>
1850
- * <code>
1851
1752
  * function setup() {
1852
1753
  * createCanvas(100, 100);
1853
1754
  *
@@ -1870,12 +1771,8 @@ function creatingReading(p5, fn){
1870
1771
  *
1871
1772
  * describe('Two rectangles. The left one is light purple and the right one is royal blue.');
1872
1773
  * }
1873
- * </code>
1874
- * </div>
1875
1774
  *
1876
1775
  * @example
1877
- * <div>
1878
- * <code>
1879
1776
  * function setup() {
1880
1777
  * createCanvas(100, 100);
1881
1778
  *
@@ -1898,12 +1795,8 @@ function creatingReading(p5, fn){
1898
1795
  *
1899
1796
  * describe('Two rectangles. The left one is light purple and the right one is royal blue.');
1900
1797
  * }
1901
- * </code>
1902
- * </div>
1903
1798
  *
1904
1799
  * @example
1905
- * <div>
1906
- * <code>
1907
1800
  * function setup() {
1908
1801
  * createCanvas(100, 100);
1909
1802
  *
@@ -1929,8 +1822,6 @@ function creatingReading(p5, fn){
1929
1822
  *
1930
1823
  * describe('Two rectangles. The left one is light purple and the right one is royal blue.');
1931
1824
  * }
1932
- * </code>
1933
- * </div>
1934
1825
  */
1935
1826
  fn.blue = function(c) {
1936
1827
  // p5._validateParameters('blue', arguments);
@@ -1951,8 +1842,6 @@ function creatingReading(p5, fn){
1951
1842
  * @return {Number} the alpha value.
1952
1843
  *
1953
1844
  * @example
1954
- * <div>
1955
- * <code>
1956
1845
  * function setup() {
1957
1846
  * createCanvas(100, 100);
1958
1847
  *
@@ -1975,12 +1864,8 @@ function creatingReading(p5, fn){
1975
1864
  *
1976
1865
  * describe('Two rectangles. The left one is light blue and the right one is charcoal gray.');
1977
1866
  * }
1978
- * </code>
1979
- * </div>
1980
1867
  *
1981
1868
  * @example
1982
- * <div>
1983
- * <code>
1984
1869
  * function setup() {
1985
1870
  * createCanvas(100, 100);
1986
1871
  *
@@ -2003,12 +1888,8 @@ function creatingReading(p5, fn){
2003
1888
  *
2004
1889
  * describe('Two rectangles. The left one is light blue and the right one is charcoal gray.');
2005
1890
  * }
2006
- * </code>
2007
- * </div>
2008
1891
  *
2009
1892
  * @example
2010
- * <div>
2011
- * <code>
2012
1893
  * function setup() {
2013
1894
  * createCanvas(100, 100);
2014
1895
  *
@@ -2031,8 +1912,6 @@ function creatingReading(p5, fn){
2031
1912
  *
2032
1913
  * describe('Two rectangles. The left one is light blue and the right one is charcoal gray.');
2033
1914
  * }
2034
- * </code>
2035
- * </div>
2036
1915
  */
2037
1916
  fn.alpha = function(c) {
2038
1917
  // p5._validateParameters('alpha', arguments);
@@ -2058,8 +1937,6 @@ function creatingReading(p5, fn){
2058
1937
  * @return {Number} the hue value.
2059
1938
  *
2060
1939
  * @example
2061
- * <div>
2062
- * <code>
2063
1940
  * function setup() {
2064
1941
  * createCanvas(100, 100);
2065
1942
  *
@@ -2087,12 +1964,8 @@ function creatingReading(p5, fn){
2087
1964
  * 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.'
2088
1965
  * );
2089
1966
  * }
2090
- * </code>
2091
- * </div>
2092
1967
  *
2093
1968
  * @example
2094
- * <div>
2095
- * <code>
2096
1969
  * function setup() {
2097
1970
  * createCanvas(100, 100);
2098
1971
  *
@@ -2120,12 +1993,8 @@ function creatingReading(p5, fn){
2120
1993
  * 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.'
2121
1994
  * );
2122
1995
  * }
2123
- * </code>
2124
- * </div>
2125
1996
  *
2126
1997
  * @example
2127
- * <div>
2128
- * <code>
2129
1998
  * function setup() {
2130
1999
  * createCanvas(100, 100);
2131
2000
  *
@@ -2153,8 +2022,6 @@ function creatingReading(p5, fn){
2153
2022
  * 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.'
2154
2023
  * );
2155
2024
  * }
2156
- * </code>
2157
- * </div>
2158
2025
  */
2159
2026
  fn.hue = function(c) {
2160
2027
  let colorMode = HSL;
@@ -2196,8 +2063,6 @@ function creatingReading(p5, fn){
2196
2063
  * @return {Number} the saturation value
2197
2064
  *
2198
2065
  * @example
2199
- * <div>
2200
- * <code>
2201
2066
  * function setup() {
2202
2067
  * createCanvas(100, 100);
2203
2068
  *
@@ -2223,12 +2088,8 @@ function creatingReading(p5, fn){
2223
2088
  *
2224
2089
  * describe('Two rectangles. The left one is salmon pink and the right one is dark gray.');
2225
2090
  * }
2226
- * </code>
2227
- * </div>
2228
2091
  *
2229
2092
  * @example
2230
- * <div>
2231
- * <code>
2232
2093
  * function setup() {
2233
2094
  * createCanvas(100, 100);
2234
2095
  *
@@ -2254,12 +2115,8 @@ function creatingReading(p5, fn){
2254
2115
  *
2255
2116
  * describe('Two rectangles. The left one is salmon pink and the right one is gray.');
2256
2117
  * }
2257
- * </code>
2258
- * </div>
2259
2118
  *
2260
2119
  * @example
2261
- * <div>
2262
- * <code>
2263
2120
  * function setup() {
2264
2121
  * createCanvas(100, 100);
2265
2122
  *
@@ -2285,12 +2142,8 @@ function creatingReading(p5, fn){
2285
2142
  *
2286
2143
  * describe('Two rectangles. The left one is salmon pink and the right one is gray.');
2287
2144
  * }
2288
- * </code>
2289
- * </div>
2290
2145
  *
2291
2146
  * @example
2292
- * <div>
2293
- * <code>
2294
2147
  * function setup() {
2295
2148
  * createCanvas(100, 100);
2296
2149
  *
@@ -2316,12 +2169,8 @@ function creatingReading(p5, fn){
2316
2169
  *
2317
2170
  * describe('Two rectangles. The left one is salmon pink and the right one is white.');
2318
2171
  * }
2319
- * </code>
2320
- * </div>
2321
2172
  *
2322
2173
  * @example
2323
- * <div>
2324
- * <code>
2325
2174
  * function setup() {
2326
2175
  * createCanvas(100, 100);
2327
2176
  *
@@ -2347,8 +2196,6 @@ function creatingReading(p5, fn){
2347
2196
  *
2348
2197
  * describe('Two rectangles. The left one is salmon pink and the right one is white.');
2349
2198
  * }
2350
- * </code>
2351
- * </div>
2352
2199
  */
2353
2200
  fn.saturation = function(c) {
2354
2201
  const colorMode = (this._renderer.states.colorMode === HSB) ? HSB : HSL;
@@ -2374,8 +2221,6 @@ function creatingReading(p5, fn){
2374
2221
  * @return {Number} the brightness value.
2375
2222
  *
2376
2223
  * @example
2377
- * <div>
2378
- * <code>
2379
2224
  * function setup() {
2380
2225
  * createCanvas(100, 100);
2381
2226
  *
@@ -2401,12 +2246,8 @@ function creatingReading(p5, fn){
2401
2246
  *
2402
2247
  * describe('Two rectangles. The left one is salmon pink and the right one is white.');
2403
2248
  * }
2404
- * </code>
2405
- * </div>
2406
2249
  *
2407
2250
  * @example
2408
- * <div>
2409
- * <code>
2410
2251
  * function setup() {
2411
2252
  * createCanvas(100, 100);
2412
2253
  *
@@ -2432,12 +2273,8 @@ function creatingReading(p5, fn){
2432
2273
  *
2433
2274
  * describe('Two rectangles. The left one is salmon pink and the right one is white.');
2434
2275
  * }
2435
- * </code>
2436
- * </div>
2437
2276
  *
2438
2277
  * @example
2439
- * <div>
2440
- * <code>
2441
2278
  * function setup() {
2442
2279
  * createCanvas(100, 100);
2443
2280
  *
@@ -2463,12 +2300,8 @@ function creatingReading(p5, fn){
2463
2300
  *
2464
2301
  * describe('Two rectangles. The left one is salmon pink and the right one is white.');
2465
2302
  * }
2466
- * </code>
2467
- * </div>
2468
2303
  *
2469
2304
  * @example
2470
- * <div>
2471
- * <code>
2472
2305
  * function setup() {
2473
2306
  * createCanvas(100, 100);
2474
2307
  *
@@ -2494,8 +2327,6 @@ function creatingReading(p5, fn){
2494
2327
  *
2495
2328
  * describe('Two rectangles. The left one is salmon pink and the right one is white.');
2496
2329
  * }
2497
- * </code>
2498
- * </div>
2499
2330
  */
2500
2331
  fn.brightness = function(c) {
2501
2332
  return this.color(c)._getBrightness(
@@ -2520,8 +2351,6 @@ function creatingReading(p5, fn){
2520
2351
  * @return {Number} the lightness value.
2521
2352
  *
2522
2353
  * @example
2523
- * <div>
2524
- * <code>
2525
2354
  * function setup() {
2526
2355
  * createCanvas(100, 100);
2527
2356
  *
@@ -2547,12 +2376,8 @@ function creatingReading(p5, fn){
2547
2376
  *
2548
2377
  * describe('Two rectangles. The left one is salmon pink and the right one is gray.');
2549
2378
  * }
2550
- * </code>
2551
- * </div>
2552
2379
  *
2553
2380
  * @example
2554
- * <div>
2555
- * <code>
2556
2381
  * function setup() {
2557
2382
  * createCanvas(100, 100);
2558
2383
  *
@@ -2578,12 +2403,8 @@ function creatingReading(p5, fn){
2578
2403
  *
2579
2404
  * describe('Two rectangles. The left one is salmon pink and the right one is gray.');
2580
2405
  * }
2581
- * </code>
2582
- * </div>
2583
2406
  *
2584
2407
  * @example
2585
- * <div>
2586
- * <code>
2587
2408
  * function setup() {
2588
2409
  * createCanvas(100, 100);
2589
2410
  *
@@ -2609,12 +2430,8 @@ function creatingReading(p5, fn){
2609
2430
  *
2610
2431
  * describe('Two rectangles. The left one is salmon pink and the right one is gray.');
2611
2432
  * }
2612
- * </code>
2613
- * </div>
2614
2433
  *
2615
2434
  * @example
2616
- * <div>
2617
- * <code>
2618
2435
  * function setup() {
2619
2436
  * createCanvas(100, 100);
2620
2437
  *
@@ -2640,8 +2457,6 @@ function creatingReading(p5, fn){
2640
2457
  *
2641
2458
  * describe('Two rectangles. The left one is salmon pink and the right one is gray.');
2642
2459
  * }
2643
- * </code>
2644
- * </div>
2645
2460
  */
2646
2461
  fn.lightness = function(c) {
2647
2462
  return this.color(c)._getLightness(
@@ -2669,8 +2484,6 @@ function creatingReading(p5, fn){
2669
2484
  * @return {p5.Color} interpolated color.
2670
2485
  *
2671
2486
  * @example
2672
- * <div>
2673
- * <code>
2674
2487
  * function setup() {
2675
2488
  * createCanvas(100, 100);
2676
2489
  *
@@ -2705,8 +2518,6 @@ function creatingReading(p5, fn){
2705
2518
  * 'Four rectangles. From left to right, the rectangles are tan, brown, brownish purple, and purple.'
2706
2519
  * );
2707
2520
  * }
2708
- * </code>
2709
- * </div>
2710
2521
  */
2711
2522
  fn.lerpColor = function(c1, c2, amt) {
2712
2523
  // p5._validateParameters('lerpColor', arguments);
@@ -2730,8 +2541,6 @@ function creatingReading(p5, fn){
2730
2541
  * @return {p5.Color} interpolated color.
2731
2542
  *
2732
2543
  * @example
2733
- * <div>
2734
- * <code>
2735
2544
  * function setup() {
2736
2545
  * createCanvas(400, 400);
2737
2546
  * }
@@ -2745,8 +2554,6 @@ function creatingReading(p5, fn){
2745
2554
  * ['blue', 1]
2746
2555
  * ], millis() / 10000 % 1));
2747
2556
  * }
2748
- * </code>
2749
- * </div>
2750
2557
  */
2751
2558
  fn.paletteLerp = function(color_stops, amt) {
2752
2559
  const first_color_stop = color_stops[0];