forked from mitushaa/Sentiment-Analysis-using-node.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
p5.global-mode.d.ts
6784 lines (6335 loc) · 232 KB
/
p5.global-mode.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file was auto-generated. Please do not edit it.
///<reference path="p5.d.ts" />
// Properties from p5
/**
* This is the p5 instance constructor. A p5 instance
* holds all the properties and methods related to a
* p5 sketch. It expects an incoming sketch closure
* and it can also take an optional node parameter
* for attaching the generated p5 canvas to a node.
* The sketch closure takes the newly created p5
* instance as its sole argument and may optionally
* set preload(), setup(), and/or draw() properties
* on it for running a sketch.
*
* A p5 sketch can run in "global" or "instance"
* mode: "global" - all properties and methods are
* attached to the window "instance" - all properties
* and methods are bound to this p5 object
*
* @param sketch a closure that can set optional
* preload(), setup(), and/or draw() properties on
* the given p5 instance
* @param [node] element to attach canvas to, if a
* boolean is passed in use it as sync
* @param [sync] start synchronously (optional)
* @return a p5 instance
*/
declare function constructor(sketch: Function, node?: HTMLElement|boolean, sync?: boolean);
// src/color/creating_reading.js
/**
* Extracts the alpha value from a color or pixel
* array.
*
* @param color p5.Color object, color components, or
* CSS color
* @return the alpha value
*/
declare function alpha(color: p5.Color|number[]|string): number;
/**
* Extracts the blue value from a color or pixel
* array.
*
* @param color p5.Color object, color components, or
* CSS color
* @return the blue value
*/
declare function blue(color: p5.Color|number[]|string): number;
/**
* Extracts the HSB brightness value from a color or
* pixel array.
*
* @param color p5.Color object, color components, or
* CSS color
* @return the brightness value
*/
declare function brightness(color: p5.Color|number[]|string): number;
/**
* Creates colors for storing in variables of the
* color datatype. The parameters are interpreted as
* RGB or HSB values depending on the current
* colorMode(). The default mode is RGB values from 0
* to 255 and, therefore, the function call
* color(255, 204, 0) will return a bright yellow
* color. Note that if only one value is provided to
* color(), it will be interpreted as a grayscale
* value. Add a second value, and it will be used for
* alpha transparency. When three values are
* specified, they are interpreted as either RGB or
* HSB values. Adding a fourth value applies alpha
* transparency.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
* @param gray number specifying value between white
* and black.
* @param [alpha] alpha value relative to current
* color range (default is 0-255)
* @return resulting color
*/
declare function color(gray: number, alpha?: number): p5.Color;
/**
* Creates colors for storing in variables of the
* color datatype. The parameters are interpreted as
* RGB or HSB values depending on the current
* colorMode(). The default mode is RGB values from 0
* to 255 and, therefore, the function call
* color(255, 204, 0) will return a bright yellow
* color. Note that if only one value is provided to
* color(), it will be interpreted as a grayscale
* value. Add a second value, and it will be used for
* alpha transparency. When three values are
* specified, they are interpreted as either RGB or
* HSB values. Adding a fourth value applies alpha
* transparency.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
* @param v1 red or hue value relative to the current
* color range
* @param v2 green or saturation value relative to
* the current color range
* @param v3 blue or brightness value relative to the
* current color range
* @param [alpha] alpha value relative to current
* color range (default is 0-255)
*/
declare function color(v1: number, v2: number, v3: number, alpha?: number): p5.Color;
/**
* Creates colors for storing in variables of the
* color datatype. The parameters are interpreted as
* RGB or HSB values depending on the current
* colorMode(). The default mode is RGB values from 0
* to 255 and, therefore, the function call
* color(255, 204, 0) will return a bright yellow
* color. Note that if only one value is provided to
* color(), it will be interpreted as a grayscale
* value. Add a second value, and it will be used for
* alpha transparency. When three values are
* specified, they are interpreted as either RGB or
* HSB values. Adding a fourth value applies alpha
* transparency.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
* @param value a color string
*/
declare function color(value: string): p5.Color;
/**
* Creates colors for storing in variables of the
* color datatype. The parameters are interpreted as
* RGB or HSB values depending on the current
* colorMode(). The default mode is RGB values from 0
* to 255 and, therefore, the function call
* color(255, 204, 0) will return a bright yellow
* color. Note that if only one value is provided to
* color(), it will be interpreted as a grayscale
* value. Add a second value, and it will be used for
* alpha transparency. When three values are
* specified, they are interpreted as either RGB or
* HSB values. Adding a fourth value applies alpha
* transparency.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
* @param values an array containing the
* red,green,blue & and alpha components of the color
*/
declare function color(values: number[]): p5.Color;
/**
* Creates colors for storing in variables of the
* color datatype. The parameters are interpreted as
* RGB or HSB values depending on the current
* colorMode(). The default mode is RGB values from 0
* to 255 and, therefore, the function call
* color(255, 204, 0) will return a bright yellow
* color. Note that if only one value is provided to
* color(), it will be interpreted as a grayscale
* value. Add a second value, and it will be used for
* alpha transparency. When three values are
* specified, they are interpreted as either RGB or
* HSB values. Adding a fourth value applies alpha
* transparency.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
*/
declare function color(color: p5.Color): p5.Color;
/**
* Extracts the green value from a color or pixel
* array.
*
* @param color p5.Color object, color components, or
* CSS color
* @return the green value
*/
declare function green(color: p5.Color|number[]|string): number;
/**
* Extracts the hue value from a color or pixel
* array. Hue exists in both HSB and HSL. This
* function will return the HSB-normalized hue when
* supplied with an HSB color object (or when
* supplied with a pixel array while the color mode
* is HSB), but will default to the HSL-normalized
* hue otherwise. (The values will only be different
* if the maximum hue setting for each system is
* different.)
*
* @param color p5.Color object, color components, or
* CSS color
* @return the hue
*/
declare function hue(color: p5.Color|number[]|string): number;
/**
* Blends two colors to find a third color somewhere
* between them. The amt parameter is the amount to
* interpolate between the two values where 0.0 equal
* to the first color, 0.1 is very near the first
* color, 0.5 is halfway in between, etc. An amount
* below 0 will be treated as 0. Likewise, amounts
* above 1 will be capped at 1. This is different
* from the behavior of lerp(), but necessary because
* otherwise numbers outside the range will produce
* strange and unexpected colors. The way that
* colours are interpolated depends on the current
* color mode.
*
* @param c1 interpolate from this color
* @param c2 interpolate to this color
* @param amt number between 0 and 1
* @return interpolated color
*/
declare function lerpColor(c1: p5.Color, c2: p5.Color, amt: number): p5.Color;
/**
* Extracts the HSL lightness value from a color or
* pixel array.
*
* @param color p5.Color object, color components, or
* CSS color
* @return the lightness
*/
declare function lightness(color: p5.Color|number[]|string): number;
/**
* Extracts the red value from a color or pixel
* array.
*
* @param color p5.Color object, color components, or
* CSS color
* @return the red value
*/
declare function red(color: p5.Color|number[]|string): number;
/**
* Extracts the saturation value from a color or
* pixel array. Saturation is scaled differently in
* HSB and HSL. This function will return the HSB
* saturation when supplied with an HSB color object
* (or when supplied with a pixel array while the
* color mode is HSB), but will default to the HSL
* saturation otherwise.
*
* @param color p5.Color object, color components, or
* CSS color
* @return the saturation value
*/
declare function saturation(color: p5.Color|number[]|string): number;
// src/color/setting.js
/**
* The background() function sets the color used for
* the background of the p5.js canvas. The default
* background is light gray. This function is
* typically used within draw() to clear the display
* window at the beginning of each frame, but it can
* be used inside setup() to set the background on
* the first frame of animation or if the background
* need only be set once. The color is either
* specified in terms of the RGB, HSB, or HSL color
* depending on the current colorMode. (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
*
* A p5.Color object can also be provided to set the
* background color.
*
*
* A p5.Image can also be provided to set the
* background image.
*
* @param color any value created by the color()
* function
* @chainable
*/
declare function background(color: p5.Color): p5;
/**
* The background() function sets the color used for
* the background of the p5.js canvas. The default
* background is light gray. This function is
* typically used within draw() to clear the display
* window at the beginning of each frame, but it can
* be used inside setup() to set the background on
* the first frame of animation or if the background
* need only be set once. The color is either
* specified in terms of the RGB, HSB, or HSL color
* depending on the current colorMode. (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
*
* A p5.Color object can also be provided to set the
* background color.
*
*
* A p5.Image can also be provided to set the
* background image.
*
* @param colorstring color string, possible formats
* include: integer rgb() or rgba(), percentage rgb()
* or rgba(), 3-digit hex, 6-digit hex
* @param [a] opacity of the background relative to
* current color range (default is 0-255)
* @chainable
*/
declare function background(colorstring: string, a?: number): p5;
/**
* The background() function sets the color used for
* the background of the p5.js canvas. The default
* background is light gray. This function is
* typically used within draw() to clear the display
* window at the beginning of each frame, but it can
* be used inside setup() to set the background on
* the first frame of animation or if the background
* need only be set once. The color is either
* specified in terms of the RGB, HSB, or HSL color
* depending on the current colorMode. (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
*
* A p5.Color object can also be provided to set the
* background color.
*
*
* A p5.Image can also be provided to set the
* background image.
*
* @param gray specifies a value between white and
* black
* @param [a] opacity of the background relative to
* current color range (default is 0-255)
* @chainable
*/
declare function background(gray: number, a?: number): p5;
/**
* The background() function sets the color used for
* the background of the p5.js canvas. The default
* background is light gray. This function is
* typically used within draw() to clear the display
* window at the beginning of each frame, but it can
* be used inside setup() to set the background on
* the first frame of animation or if the background
* need only be set once. The color is either
* specified in terms of the RGB, HSB, or HSL color
* depending on the current colorMode. (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
*
* A p5.Color object can also be provided to set the
* background color.
*
*
* A p5.Image can also be provided to set the
* background image.
*
* @param v1 red or hue value (depending on the
* current color mode)
* @param v2 green or saturation value (depending on
* the current color mode)
* @param v3 blue or brightness value (depending on
* the current color mode)
* @param [a] opacity of the background relative to
* current color range (default is 0-255)
* @chainable
*/
declare function background(v1: number, v2: number, v3: number, a?: number): p5;
/**
* The background() function sets the color used for
* the background of the p5.js canvas. The default
* background is light gray. This function is
* typically used within draw() to clear the display
* window at the beginning of each frame, but it can
* be used inside setup() to set the background on
* the first frame of animation or if the background
* need only be set once. The color is either
* specified in terms of the RGB, HSB, or HSL color
* depending on the current colorMode. (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
*
* A p5.Color object can also be provided to set the
* background color.
*
*
* A p5.Image can also be provided to set the
* background image.
*
* @param values an array containing the
* red,green,blue & and alpha components of the color
* @chainable
*/
declare function background(values: number[]): p5;
/**
* The background() function sets the color used for
* the background of the p5.js canvas. The default
* background is light gray. This function is
* typically used within draw() to clear the display
* window at the beginning of each frame, but it can
* be used inside setup() to set the background on
* the first frame of animation or if the background
* need only be set once. The color is either
* specified in terms of the RGB, HSB, or HSL color
* depending on the current colorMode. (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255.
*
*
* If a single string argument is provided, RGB, RGBA
* and Hex CSS color strings and all named color
* strings are supported. In this case, an alpha
* number value as a second argument is not
* supported, the RGBA form should be used.
*
*
* A p5.Color object can also be provided to set the
* background color.
*
*
* A p5.Image can also be provided to set the
* background image.
*
* @param image image created with loadImage() or
* createImage(), to set as background (must be same
* size as the sketch window)
* @param [a] opacity of the background relative to
* current color range (default is 0-255)
* @chainable
*/
declare function background(image: p5.Image, a?: number): p5;
/**
* Clears the pixels within a buffer. This function
* only works on p5.Canvas objects created with the
* createCanvas() function; it won't work with the
* main display window. Unlike the main graphics
* context, pixels in additional graphics areas
* created with createGraphics() can be entirely or
* partially transparent. This function clears
* everything to make all of the pixels 100%
* transparent.
*
* @chainable
*/
declare function clear(): p5;
/**
* colorMode() changes the way p5.js interprets color
* data. By default, the parameters for fill(),
* stroke(), background(), and color() are defined by
* values between 0 and 255 using the RGB color
* model. This is equivalent to setting
* colorMode(RGB, 255). Setting colorMode(HSB) lets
* you use the HSB system instead. By default, this
* is colorMode(HSB, 360, 100, 100, 1). You can also
* use HSL. Note: existing color objects remember
* the mode that they were created in, so you can
* change modes as you like without affecting their
* appearance.
*
* @param mode either RGB, HSB or HSL, corresponding
* to Red/Green/Blue and Hue/Saturation/Brightness
* (or Lightness)
* @param [max] range for all values
* @chainable
*/
declare function colorMode(mode: COLOR_MODE, max?: number): p5;
/**
* colorMode() changes the way p5.js interprets color
* data. By default, the parameters for fill(),
* stroke(), background(), and color() are defined by
* values between 0 and 255 using the RGB color
* model. This is equivalent to setting
* colorMode(RGB, 255). Setting colorMode(HSB) lets
* you use the HSB system instead. By default, this
* is colorMode(HSB, 360, 100, 100, 1). You can also
* use HSL. Note: existing color objects remember
* the mode that they were created in, so you can
* change modes as you like without affecting their
* appearance.
*
* @param mode either RGB, HSB or HSL, corresponding
* to Red/Green/Blue and Hue/Saturation/Brightness
* (or Lightness)
* @param max1 range for the red or hue depending on
* the current color mode
* @param max2 range for the green or saturation
* depending on the current color mode
* @param max3 range for the blue or
* brightness/lighntess depending on the current
* color mode
* @param [maxA] range for the alpha
* @chainable
*/
declare function colorMode(mode: any, max1: number, max2: number, max3: number, maxA?: number): p5;
/**
* Sets the color used to fill shapes. For example,
* if you run fill(204, 102, 0), all subsequent
* shapes will be filled with orange. This color is
* either specified in terms of the RGB or HSB color
* depending on the current colorMode(). (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255. If a single string argument is
* provided, RGB, RGBA and Hex CSS color strings and
* all named color strings are supported. In this
* case, an alpha number value as a second argument
* is not supported, the RGBA form should be used.
*
*
* A p5 Color object can also be provided to set the
* fill color.
*
* @param v1 red or hue value relative to the current
* color range
* @param v2 green or saturation value relative to
* the current color range
* @param v3 blue or brightness value relative to the
* current color range
* @chainable
*/
declare function fill(v1: number, v2: number, v3: number, alpha?: number): p5;
/**
* Sets the color used to fill shapes. For example,
* if you run fill(204, 102, 0), all subsequent
* shapes will be filled with orange. This color is
* either specified in terms of the RGB or HSB color
* depending on the current colorMode(). (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255. If a single string argument is
* provided, RGB, RGBA and Hex CSS color strings and
* all named color strings are supported. In this
* case, an alpha number value as a second argument
* is not supported, the RGBA form should be used.
*
*
* A p5 Color object can also be provided to set the
* fill color.
*
* @param value a color string
* @chainable
*/
declare function fill(value: string): p5;
/**
* Sets the color used to fill shapes. For example,
* if you run fill(204, 102, 0), all subsequent
* shapes will be filled with orange. This color is
* either specified in terms of the RGB or HSB color
* depending on the current colorMode(). (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255. If a single string argument is
* provided, RGB, RGBA and Hex CSS color strings and
* all named color strings are supported. In this
* case, an alpha number value as a second argument
* is not supported, the RGBA form should be used.
*
*
* A p5 Color object can also be provided to set the
* fill color.
*
* @param gray a gray value
* @chainable
*/
declare function fill(gray: number, alpha?: number): p5;
/**
* Sets the color used to fill shapes. For example,
* if you run fill(204, 102, 0), all subsequent
* shapes will be filled with orange. This color is
* either specified in terms of the RGB or HSB color
* depending on the current colorMode(). (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255. If a single string argument is
* provided, RGB, RGBA and Hex CSS color strings and
* all named color strings are supported. In this
* case, an alpha number value as a second argument
* is not supported, the RGBA form should be used.
*
*
* A p5 Color object can also be provided to set the
* fill color.
*
* @param values an array containing the
* red,green,blue & and alpha components of the color
* @chainable
*/
declare function fill(values: number[]): p5;
/**
* Sets the color used to fill shapes. For example,
* if you run fill(204, 102, 0), all subsequent
* shapes will be filled with orange. This color is
* either specified in terms of the RGB or HSB color
* depending on the current colorMode(). (The default
* color space is RGB, with each value in the range
* from 0 to 255). The alpha range by default is also
* 0 to 255. If a single string argument is
* provided, RGB, RGBA and Hex CSS color strings and
* all named color strings are supported. In this
* case, an alpha number value as a second argument
* is not supported, the RGBA form should be used.
*
*
* A p5 Color object can also be provided to set the
* fill color.
*
* @param color the fill color
* @chainable
*/
declare function fill(color: p5.Color): p5;
/**
* Disables filling geometry. If both noStroke() and
* noFill() are called, nothing will be drawn to the
* screen.
*
* @chainable
*/
declare function noFill(): p5;
/**
* Disables drawing the stroke (outline). If both
* noStroke() and noFill() are called, nothing will
* be drawn to the screen.
*
* @chainable
*/
declare function noStroke(): p5;
/**
* Sets the color used to draw lines and borders
* around shapes. This color is either specified in
* terms of the RGB or HSB color depending on the
* current colorMode() (the default color space is
* RGB, with each value in the range from 0 to 255).
* The alpha range by default is also 0 to 255. If a
* single string argument is provided, RGB, RGBA and
* Hex CSS color strings and all named color strings
* are supported. In this case, an alpha number value
* as a second argument is not supported, the RGBA
* form should be used.
*
*
* A p5 Color object can also be provided to set the
* stroke color.
*
* @param v1 red or hue value relative to the current
* color range
* @param v2 green or saturation value relative to
* the current color range
* @param v3 blue or brightness value relative to the
* current color range
* @chainable
*/
declare function stroke(v1: number, v2: number, v3: number, alpha?: number): p5;
/**
* Sets the color used to draw lines and borders
* around shapes. This color is either specified in
* terms of the RGB or HSB color depending on the
* current colorMode() (the default color space is
* RGB, with each value in the range from 0 to 255).
* The alpha range by default is also 0 to 255. If a
* single string argument is provided, RGB, RGBA and
* Hex CSS color strings and all named color strings
* are supported. In this case, an alpha number value
* as a second argument is not supported, the RGBA
* form should be used.
*
*
* A p5 Color object can also be provided to set the
* stroke color.
*
* @param value a color string
* @chainable
*/
declare function stroke(value: string): p5;
/**
* Sets the color used to draw lines and borders
* around shapes. This color is either specified in
* terms of the RGB or HSB color depending on the
* current colorMode() (the default color space is
* RGB, with each value in the range from 0 to 255).
* The alpha range by default is also 0 to 255. If a
* single string argument is provided, RGB, RGBA and
* Hex CSS color strings and all named color strings
* are supported. In this case, an alpha number value
* as a second argument is not supported, the RGBA
* form should be used.
*
*
* A p5 Color object can also be provided to set the
* stroke color.
*
* @param gray a gray value
* @chainable
*/
declare function stroke(gray: number, alpha?: number): p5;
/**
* Sets the color used to draw lines and borders
* around shapes. This color is either specified in
* terms of the RGB or HSB color depending on the
* current colorMode() (the default color space is
* RGB, with each value in the range from 0 to 255).
* The alpha range by default is also 0 to 255. If a
* single string argument is provided, RGB, RGBA and
* Hex CSS color strings and all named color strings
* are supported. In this case, an alpha number value
* as a second argument is not supported, the RGBA
* form should be used.
*
*
* A p5 Color object can also be provided to set the
* stroke color.
*
* @param values an array containing the
* red,green,blue & and alpha components of the color
* @chainable
*/
declare function stroke(values: number[]): p5;
/**
* Sets the color used to draw lines and borders
* around shapes. This color is either specified in
* terms of the RGB or HSB color depending on the
* current colorMode() (the default color space is
* RGB, with each value in the range from 0 to 255).
* The alpha range by default is also 0 to 255. If a
* single string argument is provided, RGB, RGBA and
* Hex CSS color strings and all named color strings
* are supported. In this case, an alpha number value
* as a second argument is not supported, the RGBA
* form should be used.
*
*
* A p5 Color object can also be provided to set the
* stroke color.
*
* @param color the stroke color
* @chainable
*/
declare function stroke(color: p5.Color): p5;
// src/core/2d_primitives.js
/**
* Draw an arc to the screen. If called with only x,
* y, w, h, start, and stop, the arc will be drawn
* and filled as an open pie segment. If a mode
* parameter is provided, the arc will be filled like
* an open semi-circle (OPEN) , a closed semi-circle
* (CHORD), or as a closed pie segment (PIE). The
* origin may be changed with the ellipseMode()
* function. Note that drawing a full circle (ex: 0
* to TWO_PI) will appear blank because 0 and TWO_PI
* are the same position on the unit circle. The best
* way to handle this is by using the ellipse()
* function instead to create a closed ellipse, and
* to use the arc() function only to draw parts of an
* ellipse.
*
* @param x x-coordinate of the arc's ellipse
* @param y y-coordinate of the arc's ellipse
* @param w width of the arc's ellipse by default
* @param h height of the arc's ellipse by default
* @param start angle to start the arc, specified in
* radians
* @param stop angle to stop the arc, specified in
* radians
* @param [mode] optional parameter to determine the
* way of drawing the arc. either CHORD, PIE or OPEN
* @chainable
*/
declare function arc(x: number, y: number, w: number, h: number, start: number, stop: number, mode?: ARC_MODE): p5;
/**
* Draws an ellipse (oval) to the screen. An ellipse
* with equal width and height is a circle. By
* default, the first two parameters set the
* location, and the third and fourth parameters set
* the shape's width and height. If no height is
* specified, the value of width is used for both the
* width and height. If a negative height or width is
* specified, the absolute value is taken. The origin
* may be changed with the ellipseMode() function.
*
* @param x x-coordinate of the ellipse.
* @param y y-coordinate of the ellipse.
* @param w width of the ellipse.
* @param [h] height of the ellipse.
* @chainable
*/
declare function ellipse(x: number, y: number, w: number, h?: number): p5;
/**
* Draws an ellipse (oval) to the screen. An ellipse
* with equal width and height is a circle. By
* default, the first two parameters set the
* location, and the third and fourth parameters set
* the shape's width and height. If no height is
* specified, the value of width is used for both the
* width and height. If a negative height or width is
* specified, the absolute value is taken. The origin
* may be changed with the ellipseMode() function.
*
* @param x x-coordinate of the ellipse.
* @param y y-coordinate of the ellipse.
* @param w width of the ellipse.
* @param h height of the ellipse.
* @param detail number of radial sectors to draw
*/
declare function ellipse(x: number, y: number, w: number, h: number, detail: number): void;
/**
* Draws a line (a direct path between two points) to
* the screen. The version of line() with four
* parameters draws the line in 2D. To color a line,
* use the stroke() function. A line cannot be
* filled, therefore the fill() function will not
* affect the color of a line. 2D lines are drawn
* with a width of one pixel by default, but this can
* be changed with the strokeWeight() function.
*
* @param x1 the x-coordinate of the first point
* @param y1 the y-coordinate of the first point
* @param x2 the x-coordinate of the second point
* @param y2 the y-coordinate of the second point
* @chainable
*/
declare function line(x1: number, y1: number, x2: number, y2: number): p5;
/**
* Draws a line (a direct path between two points) to
* the screen. The version of line() with four
* parameters draws the line in 2D. To color a line,
* use the stroke() function. A line cannot be
* filled, therefore the fill() function will not
* affect the color of a line. 2D lines are drawn
* with a width of one pixel by default, but this can
* be changed with the strokeWeight() function.
*
* @param x1 the x-coordinate of the first point
* @param y1 the y-coordinate of the first point
* @param z1 the z-coordinate of the first point
* @param x2 the x-coordinate of the second point
* @param y2 the y-coordinate of the second point
* @param z2 the z-coordinate of the second point
* @chainable
*/
declare function line(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number): p5;
/**
* Draws a point, a coordinate in space at the
* dimension of one pixel. The first parameter is the
* horizontal value for the point, the second value
* is the vertical value for the point. The color of
* the point is determined by the current stroke.
*
* @param x the x-coordinate
* @param y the y-coordinate
* @param [z] the z-coordinate (for WEBGL mode)
* @chainable
*/
declare function point(x: number, y: number, z?: number): p5;
/**
* Draw a quad. A quad is a quadrilateral, a four
* sided polygon. It is similar to a rectangle, but
* the angles between its edges are not constrained
* to ninety degrees. The first pair of parameters
* (x1,y1) sets the first vertex and the subsequent
* pairs should proceed clockwise or
* counter-clockwise around the defined shape.
*
* @param x1 the x-coordinate of the first point
* @param y1 the y-coordinate of the first point
* @param x2 the x-coordinate of the second point
* @param y2 the y-coordinate of the second point
* @param x3 the x-coordinate of the third point
* @param y3 the y-coordinate of the third point
* @param x4 the x-coordinate of the fourth point
* @param y4 the y-coordinate of the fourth point
* @chainable
*/
declare function quad(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): p5;
/**
* Draw a quad. A quad is a quadrilateral, a four
* sided polygon. It is similar to a rectangle, but
* the angles between its edges are not constrained
* to ninety degrees. The first pair of parameters
* (x1,y1) sets the first vertex and the subsequent
* pairs should proceed clockwise or
* counter-clockwise around the defined shape.
*
* @param x1 the x-coordinate of the first point
* @param y1 the y-coordinate of the first point
* @param x2 the x-coordinate of the second point
* @param y2 the y-coordinate of the second point
* @param x3 the x-coordinate of the third point
* @param y3 the y-coordinate of the third point