forked from quil/quil-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi-2.6.0.clj
3482 lines (3482 loc) · 180 KB
/
api-2.6.0.clj
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
{rotate-x
{:args ({:value [angle], :type :both}),
:category "Transform",
:added "1.0",
:name rotate-x,
:subcategory nil,
:type :both,
:processing-name "rotateX()",
:requires-bindings true,
:link "http://www.processing.org/reference/rotateX_.html",
:docstring
"Rotates a shape around the x-axis the amount specified by the angle\n parameter. Angles should be specified in radians (values from 0 to\n (* PI 2)) or converted to radians with the radians function. Objects\n are always rotated around their relative position to the origin and\n positive numbers rotate objects in a counterclockwise\n direction. Transformations apply to everything that happens after\n and subsequent calls to the function accumulates the effect. For\n example, calling (rotate-x HALF-PI) and then (rotate-x HALF-PI) is\n the same as (rotate-x PI). If rotate-x is called within the draw fn,\n the transformation is reset when the loop begins again. This\n function requires either the :p3d or :opengl renderer.",
:what :fn},
print-projection
{:args ({:value [], :type :both}),
:category "Lights, Camera",
:added "1.0",
:name print-projection,
:subcategory "Camera",
:type :both,
:processing-name "printProjection()",
:requires-bindings true,
:link "http://www.processing.org/reference/printProjection_.html",
:docstring
"Prints the current projection matrix to std out. Useful for\n debugging",
:what :fn},
screen-height
{:args #{[]},
:category "Environment",
:added "1.0",
:name screen-height,
:subcategory nil,
:type :clj,
:processing-name nil,
:requires-bindings false,
:link nil,
:docstring "Returns the height of the main screen in pixels.",
:what :fn},
raw-key
{:args ({:value [], :type :both}),
:category "Input",
:added "1.0",
:name raw-key,
:subcategory "Keyboard",
:type :both,
:processing-name "key",
:requires-bindings true,
:link "http://www.processing.org/reference/key.html",
:docstring
"Contains the value of the most recent key on the keyboard that was\n used (either pressed or released).\n\n For non-ASCII keys, use the keyCode variable. The keys included in\n the ASCII specification (BACKSPACE, TAB, ENTER, RETURN, ESC, and\n DELETE) do not require checking to see if they key is coded, and you\n should simply use the key variable instead of keyCode If you're\n making cross-platform projects, note that the ENTER key is commonly\n used on PCs and Unix and the RETURN key is used instead on\n Macintosh. Check for both ENTER and RETURN to make sure your program\n will work for all platforms.",
:what :fn},
text-char
{:args
({:value [c x y z], :type :both} {:value [c x y], :type :both}),
:category "Typography",
:added "1.0",
:name text-char,
:subcategory "Loading & Displaying",
:type :both,
:processing-name "text()",
:requires-bindings true,
:link "http://www.processing.org/reference/text_.html",
:docstring
"Draws a char to the screen in the specified position. See text fn\n for more details.",
:what :fn},
display-filter
{:args
({:value [mode level], :type :both} {:value [mode], :type :both}),
:category "Image",
:added "1.0",
:name display-filter,
:subcategory "Pixels",
:type :both,
:processing-name "filter()",
:requires-bindings true,
:link "http://www.processing.org/reference/filter_.html",
:docstring
"Originally named filter in Processing Language.\n Filters the display window with the specified mode and level.\n Level defines the quality of the filter and mode may be one of the\n following keywords:\n\n :threshold - converts the image to black and white pixels depending\n if they are above or below the threshold defined by\n the level parameter. The level must be between\n 0.0 (black) and 1.0 (white). If no level is specified,\n 0.5 is used.\n :gray - converts any colors in the image to grayscale\n equivalents. Doesn't work with level.\n :invert - sets each pixel to its inverse value. Doesn't work with\n level.\n :posterize - limits each channel of the image to the number of\n colors specified as the level parameter. The parameter can\n be set to values between 2 and 255, but results are most\n noticeable in the lower ranges.\n :blur - executes a Guassian blur with the level parameter\n specifying the extent of the blurring. If no level\n parameter is used, the blur is equivalent to Guassian\n blur of radius 1.\n :opaque - sets the alpha channel to entirely opaque. Doesn't work\n with level.\n :erode - reduces the light areas. Doesn't work with level.\n :dilate - increases the light areas. Doesn't work with level.",
:what :fn},
rotate-z
{:args ({:value [angle], :type :both}),
:category "Transform",
:added "1.0",
:name rotate-z,
:subcategory nil,
:type :both,
:processing-name "rotateZ()",
:requires-bindings true,
:link "http://www.processing.org/reference/rotateZ_.html",
:docstring
"Rotates a shape around the z-axis the amount specified by the angle\n parameter. Angles should be specified in radians (values from 0\n to (* PI 2)) or converted to radians with the radians function.\n Objects are always rotated around their relative position to the\n origin and positive numbers rotate objects in a counterclockwise\n direction. Transformations apply to everything that happens after\n and subsequent calls to the function accumulates the effect. For\n example, calling (rotate-z HALF-PI) and then (rotate-z HALF-PI) is\n the same as (rotate-z PI). If rotate-y is called within the draw fn,\n the transformation is reset when the loop begins again. This\n function requires either the :p3d or :opengl renderer.",
:what :fn},
random-gaussian
{:args ({:value [], :type :both}),
:category "Math",
:added "2.0",
:name random-gaussian,
:subcategory "Random",
:type :both,
:processing-name "randomGaussian()",
:requires-bindings true,
:link "http://www.processing.org/reference/randomGaussian_.html",
:docstring
"Returns a float from a random series of numbers having a mean of 0 and\n standard deviation of 1. Each time the randomGaussian() function is called,\n it returns a number fitting a Gaussian, or normal, distribution.\n There is theoretically no minimum or maximum value that randomGaussian()\n might return. Rather, there is just a very low probability that values far\n from the mean will be returned; and a higher probability that numbers near\n the mean will be returned. .",
:what :fn},
blend
{:args
({:value [x y width height dx dy dwidth dheight mode], :type :both}
{:value [src-img x y width height dx dy dwidth dheight mode],
:type :both}
{:value
[src-img dest-img x y width height dx dy dwidth dheight mode],
:type :both}),
:category "Image",
:added "1.0",
:name blend,
:subcategory "Pixels",
:type :both,
:processing-name "blend()",
:requires-bindings true,
:link "http://www.processing.org/reference/blend_.html",
:docstring
"Blends a region of pixels from one image into another with full alpha\n channel support. If src is not specified it defaults to current-graphics.\n If dest is not specified it defaults to current-graphics.\n\n Note: blend-mode function is recommended to use instead of this one.\n\n Available blend modes are:\n\n :blend - linear interpolation of colours: C = A*factor + B\n :add - additive blending with white clip:\n C = min(A*factor + B, 255)\n :subtract - subtractive blending with black clip:\n C = max(B - A*factor, 0)\n :darkest - only the darkest colour succeeds:\n C = min(A*factor, B)\n :lightest - only the lightest colour succeeds:\n C = max(A*factor, B)\n :difference - subtract colors from underlying image.\n :exclusion - similar to :difference, but less extreme.\n :multiply - Multiply the colors, result will always be darker.\n :screen - Opposite multiply, uses inverse values of the colors.\n :overlay - A mix of :multiply and :screen. Multiplies dark values\n and screens light values.\n :hard-light - :screen when greater than 50% gray, :multiply when\n lower.\n :soft-light - Mix of :darkest and :lightest. Works like :overlay,\n but not as harsh.\n :dodge - Lightens light tones and increases contrast, ignores\n darks.\n Called \"Color Dodge\" in Illustrator and Photoshop.\n :burn - Darker areas are applied, increasing contrast, ignores\n lights. Called \"Color Burn\" in Illustrator and\n Photoshop.",
:what :fn},
frame-count
{:args ({:value [], :type :both}),
:category "Environment",
:added "1.0",
:name frame-count,
:subcategory nil,
:type :both,
:processing-name "frameCount",
:requires-bindings true,
:link "http://www.processing.org/reference/frameCount.html",
:docstring
"The system variable frameCount contains the number of frames\n displayed since the program started. Inside setup() the value is 0\n and after the first iteration of draw it is 1, etc.",
:what :fn},
with-graphics
{:args ({:value [graphics & body], :type :both}),
:category "Rendering",
:added "1.7",
:name with-graphics,
:type :both,
:processing-name nil,
:requires-bindings true,
:link nil,
:docstring
"All subsequent calls of any drawing function will draw on given\n graphics. 'with-graphics' cannot be nested (you can draw simultaneously\n only on 1 graphics)",
:what :macro},
model-y
{:args ({:value [x y z], :type :both}),
:category "Lights, Camera",
:added "1.0",
:name model-y,
:subcategory "Coordinates",
:type :both,
:processing-name "modelY()",
:requires-bindings true,
:link "http://www.processing.org/reference/modelY_.html",
:docstring
"Returns the three-dimensional x, y, z position in model space. This\n returns the y value for a given coordinate based on the current set\n of transformations (scale, rotate, translate, etc.) The y value can\n be used to place an object in space relative to the location of the\n original point once the transformations are no longer in use.",
:what :fn},
set-image
{:args ({:value [x y src], :type :both}),
:category "Image",
:added "1.0",
:name set-image,
:subcategory "Pixels",
:type :both,
:processing-name "set()",
:requires-bindings true,
:link "http://www.processing.org/reference/set_.html",
:docstring
"Writes an image directly into the display window. The x and y\n parameters define the coordinates for the upper-left corner of the\n image.",
:what :fn},
shape-mode
{:args ({:value [mode], :type :both}),
:category "Shape",
:added "1.0",
:name shape-mode,
:subcategory "Loading & Displaying",
:type :both,
:processing-name "shapeMode()",
:requires-bindings true,
:link "http://www.processing.org/reference/shapeMode_.html",
:docstring
"Modifies the location from which shapes draw. Available modes are\n :corner, :corners and :center. Default is :corner.\n\n :corner - specifies the location to be the upper left corner of the\n shape and uses the third and fourth parameters of shape\n to specify the width and height.\n\n :corners - uses the first and second parameters of shape to set\n the location of one corner and uses the third and fourth\n parameters to set the opposite corner.\n\n :center - draws the shape from its center point and uses the third\n and forth parameters of shape to specify the width and\n height. ",
:what :fn},
cursor-image
{:args
({:value [img hx hy], :type :both} {:value [img], :type :both}),
:category "Environment",
:added "1.0",
:name cursor-image,
:subcategory nil,
:type :both,
:processing-name "cursor()",
:requires-bindings true,
:link "http://www.processing.org/reference/cursor_.html",
:docstring
"Set the cursor to a predefined image. The horizontal and vertical\n active spots of the cursor may be specified with hx and hy.\n It is recommended to make the size 16x16 or 32x32 pixels.",
:what :fn},
create-graphics
{:args
({:value [w h renderer path], :type :both}
{:value [w h], :type :both}
{:value [w h renderer], :type :both}),
:category "Image",
:added "1.0",
:name create-graphics,
:subcategory "Rendering",
:type :both,
:processing-name "createGraphics()",
:requires-bindings true,
:link "http://www.processing.org/reference/createGraphics_.html",
:docstring
"Creates and returns a new PGraphics object of the types :p2d, :p3d,\n :java2d, :pdf. By default :java2d is used. Use this class if you\n need to draw into an off-screen graphics buffer. It's not possible\n to use create-graphics with the :opengl renderer, because it doesn't\n allow offscreen use. The :pdf renderer requires the filename parameter.\n\n Note: don't use create-graphics in draw in clojurescript, it leaks memory.\n You should create graphic in setup and reuse it in draw instead of creating\n a new one.\n\n It's important to call any drawing commands between (.beginDraw graphics) and\n (.endDraw graphics) statements or use with-graphics macro. This is also true\n for any commands that affect drawing, such as smooth or color-mode.\n\n If you're using :pdf renderer - don't forget to call (.dispose graphics)\n as last command inside with-graphics macro, otherwise graphics won't be\n saved.\n\n Unlike the main drawing surface which is completely opaque, surfaces\n created with create-graphics can have transparency. This makes it\n possible to draw into a graphics and maintain the alpha channel. By\n using save to write a PNG or TGA file, the transparency of the\n graphics object will be honored.",
:what :fn},
update-pixels
{:args ({:value [img], :type :both} {:value [], :type :both}),
:category "Image",
:added "1.0",
:name update-pixels,
:subcategory "Pixels",
:type :both,
:processing-name "updatePixels()",
:requires-bindings true,
:link "http://www.processing.org/reference/updatePixels_.html",
:docstring
"Updates the display window or image with the data in the pixels array.\n Use in conjunction with (pixels). If you're only reading pixels from\n the array, there's no need to call update-pixels unless there are\n changes.\n\n Certain renderers may or may not seem to require pixels or\n update-pixels. However, the rule is that any time you want to\n manipulate the pixels array, you must first call pixels, and\n after changes have been made, call update-pixels. Even if the\n renderer may not seem to use this function in the current Processing\n release, this will always be subject to change.",
:what :fn},
text-size
{:args ({:value [size], :type :both}),
:category "Typography",
:added "1.0",
:name text-size,
:subcategory "Attributes",
:type :both,
:processing-name "textSize()",
:requires-bindings true,
:link "http://www.processing.org/reference/textSize_.html",
:docstring
"Sets the current font size. This size will be used in all\n subsequent calls to the text fn. Font size is measured in\n units of pixels.",
:what :fn},
pixels
{:args ({:value [img], :type :both} {:value [], :type :both}),
:category "Image",
:added "1.0",
:name pixels,
:subcategory "Pixels",
:type :both,
:processing-name "pixels[]",
:requires-bindings true,
:link "http://www.processing.org/reference/pixels.html",
:docstring
"Array containing the values for all the pixels in the display\n window or image. This array is therefore the size of the display window. If\n this array is modified, the update-pixels fn must be called to update\n the changes. Calls .loadPixels before obtaining the pixel array.",
:what :fn},
stroke-float
{:args
({:value [gray], :type :both}
{:value [x y z a], :type :both}
{:value [x y z], :type :both}
{:value [gray alpha], :type :both}),
:category "Color",
:added "1.0",
:name stroke-float,
:subcategory "Setting",
:type :both,
:processing-name "stroke()",
:requires-bindings true,
:link "http://www.processing.org/reference/stroke_.html",
:docstring
"Sets the color used to draw lines and borders around\n shapes. Converts all args to floats",
:what :fn},
font-available?
{:args #{[font-str]},
:category "Typography",
:added "1.0",
:name font-available?,
:subcategory "Loading & Displaying",
:type :clj,
:processing-name nil,
:requires-bindings false,
:link nil,
:docstring
"Returns true if font (specified as a string) is available on this\n system, false otherwise",
:what :fn},
constrain
{:args ({:value [amt low high], :type :both}),
:category "Math",
:added "1.0",
:name constrain,
:subcategory "Calculation",
:type :both,
:processing-name "constrain()",
:requires-bindings false,
:link "http://www.processing.org/reference/constrain_.html",
:docstring
"Constrains a value to not exceed a maximum and minimum value.",
:what :fn},
screen-y
{:args ({:value [x y], :type :both} {:value [x y z], :type :both}),
:category "Lights, Camera",
:added "1.0",
:name screen-y,
:subcategory "Coordinates",
:type :both,
:processing-name "screenY()",
:requires-bindings true,
:link "http://www.processing.org/reference/screenY_.html",
:docstring
"Takes a three-dimensional x, y, z position and returns the y value\n for where it will appear on a (two-dimensional) screen, once\n affected by translate, scale or any other transformations",
:what :fn},
reset-shader
{:args #{[kind] []},
:category "Rendering",
:added "2.0",
:name reset-shader,
:subcategory "Shaders",
:type :clj,
:processing-name "resetShader()",
:requires-bindings true,
:link "http://www.processing.org/reference/resetShader_.html",
:docstring
"Restores the default shaders. Code that runs after (reset-shader) will\n not be affected by previously defined shaders. Optional 'kind' parameter -\n type of shader, either :points, :lines, or :triangles",
:what :fn},
fill-float
{:args
({:value [gray], :type :both}
{:value [r g b], :type :both}
{:value [r g b alpha], :type :both}
{:value [gray alpha], :type :both}),
:category "Color",
:added "1.0",
:name fill-float,
:subcategory "Setting",
:type :both,
:processing-name "fill()",
:requires-bindings true,
:link "http://www.processing.org/reference/fill_.html",
:docstring
"Sets the color used to fill shapes. For example, (fill 204 102 0),\n will specify that all subsequent shapes will be filled with orange.",
:what :fn},
rect
{:args
({:value [x y width height r], :type :both}
{:value [x y width height], :type :both}
{:value
[x
y
width
height
top-left-r
top-right-r
bottom-right-r
bottom-left-r],
:type :both}),
:category "Shape",
:added "1.0",
:name rect,
:subcategory "2D Primitives",
:type :both,
:processing-name "rect()",
:requires-bindings true,
:link "http://www.processing.org/reference/rect_.html",
:docstring
"Draws a rectangle to the screen. A rectangle is a four-sided shape\n with every angle at ninety degrees. By default, the first two\n parameters set the location of the upper-left corner, the third\n sets the width, and the fourth sets the height. These parameters\n may be changed with rect-mode.\n\n To draw a rounded rectangle, add a fifth parameter, which is used as\n the radius value for all four corners. To use a different radius value\n for each corner, include eight parameters.",
:what :fn},
log
{:args ({:value [val], :type :both}),
:category "Math",
:added "1.0",
:name log,
:subcategory "Calculation",
:type :both,
:processing-name "log()",
:requires-bindings false,
:link "http://www.processing.org/reference/log_.html",
:docstring
"Calculates the natural logarithm (the base-e logarithm) of a\n number. This function expects the values greater than 0.0.",
:what :fn},
with-stroke
{:args ({:value [stroke-args & body], :type :both}),
:category "Color",
:added "1.7",
:name with-stroke,
:subcategory "Utility Macros",
:type :both,
:processing-name nil,
:requires-bindings true,
:link nil,
:docstring
"Temporarily set the stroke color for the body of this macro.\n The code outside of with-stroke form will have the previous stroke color set.\n\n The stroke color has to be in a vector!\n Example: (with-stroke [255] ...)\n (with-stroke [10 80 98] ...)",
:what :macro},
ambient-float
{:args ({:value [gray], :type :both} {:value [x y z], :type :both}),
:category "Lights, Camera",
:added "1.0",
:name ambient-float,
:subcategory "Material Properties",
:type :both,
:processing-name "ambient()",
:requires-bindings true,
:link "http://www.processing.org/reference/ambient_.html",
:docstring
"Sets the ambient reflectance for shapes drawn to the screen. This\n is combined with the ambient light component of environment. The\n color components set through the parameters define the\n reflectance. For example in the default color mode, setting x=255,\n y=126, z=0, would cause all the red light to reflect and half of the\n green light to reflect. Used in combination with emissive, specular,\n and shininess in setting the material properties of shapes.",
:what :fn},
key-modifiers
{:args #{[]},
:category "Input",
:added "2.4.0",
:name key-modifiers,
:subcategory "Keyboard",
:type :clj,
:processing-name nil,
:requires-bindings true,
:link nil,
:docstring
"Set of key modifiers that were pressed when event happened.\n Possible modifiers :ctrl, :alt, :shift, :meta. Not available in\n ClojureScript.",
:what :fn},
end-raw
{:args ({:value [], :type :both}),
:category "Output",
:added "1.0",
:name end-raw,
:subcategory "Files",
:type :both,
:processing-name "endRaw()",
:requires-bindings true,
:link "http://www.processing.org/reference/endRaw_.html",
:docstring
"Complement to begin-raw; they must always be used together. See\n the begin-raw docstring for details.",
:what :fn},
radians
{:args ({:value [degrees], :type :both}),
:category "Math",
:added "1.0",
:name radians,
:subcategory "Trigonometry",
:type :both,
:processing-name "radians()",
:requires-bindings false,
:link "http://www.processing.org/reference/radians_.html",
:docstring
"Converts a degree measurement to its corresponding value in\n radians. Radians and degrees are two ways of measuring the same\n thing. There are 360 degrees in a circle and 2*PI radians in a\n circle. For example, 90° = PI/2 = 1.5707964. All trigonometric\n methods in Processing require their parameters to be specified in\n radians.",
:what :fn},
degrees
{:args ({:value [radians], :type :both}),
:category "Math",
:added "1.0",
:name degrees,
:subcategory "Trigonometry",
:type :both,
:processing-name "degrees()",
:requires-bindings false,
:link "http://www.processing.org/reference/degrees_.html",
:docstring
"Converts a radian measurement to its corresponding value in\n degrees. Radians and degrees are two ways of measuring the same\n thing. There are 360 degrees in a circle and (* 2 Math/PI) radians\n in a circle. For example, (= 90° (/ Math/PI 2) 1.5707964). All\n trigonometric methods in Processing require their parameters to be\n specified in radians.",
:what :fn},
acos
{:args ({:value [n], :type :both}),
:category "Math",
:added "1.0",
:name acos,
:subcategory "Trigonometry",
:type :both,
:processing-name "acos()",
:requires-bindings false,
:link "http://www.processing.org/reference/acos_.html",
:docstring
"The inverse of cos, returns the arc cosine of a value. This\n function expects the values in the range of -1 to 1 and values are\n returned in the range 0 to Math/PI (3.1415927).",
:what :fn},
bezier-detail
{:args ({:value [detail], :type :both}),
:category "Shape",
:added "1.0",
:name bezier-detail,
:subcategory "Curves",
:type :both,
:processing-name "bezierDetail()",
:requires-bindings true,
:link "http://www.processing.org/reference/bezierDetail_.html",
:docstring
"Sets the resolution at which Beziers display. The default value is\n 20. This function is only useful when using the :p3d or :opengl\n renderer as the default (:java2d) renderer does not use this\n information.",
:what :fn},
texture
{:args ({:value [img], :type :both}),
:category "Shape",
:added "1.0",
:name texture,
:subcategory "Vertex",
:type :both,
:processing-name "texture()",
:requires-bindings true,
:link "http://www.processing.org/reference/texture_.html",
:docstring
"Sets a texture to be applied to vertex points. The texture fn must\n be called between begin-shape and end-shape and before any calls to\n vertex.\n\n When textures are in use, the fill color is ignored. Instead, use\n tint to specify the color of the texture as it is applied to the\n shape.",
:what :fn},
stroke-int
{:args
({:value [rgb alpha], :type :both} {:value [rgb], :type :both}),
:category "Color",
:added "1.0",
:name stroke-int,
:subcategory "Setting",
:type :both,
:processing-name "stroke()",
:requires-bindings true,
:link "http://www.processing.org/reference/stroke_.html",
:docstring
"Sets the color used to draw lines and borders around\n shapes. Converts rgb to int and alpha to a float.",
:what :fn},
print-camera
{:args ({:value [], :type :both}),
:category "Lights, Camera",
:added "1.0",
:name print-camera,
:subcategory "Camera",
:type :both,
:processing-name "printCamera()",
:requires-bindings true,
:link "http://www.processing.org/reference/printCamera_.html",
:docstring
"Prints the current camera matrix to std out. Useful for debugging.",
:what :fn},
floor
{:args ({:value [n], :type :both}),
:category "Math",
:added "2.0",
:name floor,
:subcategory "Calculation",
:type :both,
:processing-name "floor()",
:requires-bindings false,
:link "http://www.processing.org/reference/floor_.html",
:docstring
"Calculates the closest int value that is less than or equal to the\n value of the parameter. For example, (floor 9.03) returns the value 9.",
:what :fn},
atan2
{:args ({:value [y x], :type :both}),
:category "Math",
:added "1.0",
:name atan2,
:subcategory "Trigonometry",
:type :both,
:processing-name "atan2()",
:requires-bindings false,
:link "http://www.processing.org/reference/atan2_.html",
:docstring
"Calculates the angle (in radians) from a specified point to the\n coordinate origin as measured from the positive x-axis. Values are\n returned as a float in the range from PI to -PI. The atan2 function\n is most often used for orienting geometry to the position of the\n cursor. Note: The y-coordinate of the point is the first parameter\n and the x-coordinate is the second due to the structure of\n calculating the tangent.",
:what :fn},
shader
{:args #{[shader kind] [shader]},
:category "Rendering",
:added "2.0",
:name shader,
:subcategory "Shaders",
:type :clj,
:processing-name "shader()",
:requires-bindings true,
:link "http://www.processing.org/reference/shader_.html",
:docstring
"Applies the shader specified by the parameters. It's compatible with the :p2d\n and :p3drenderers, but not with the default :java2d renderer. Optional 'kind'\n parameter - type of shader, either :points, :lines, or :triangles",
:what :fn},
millis
{:args ({:value [], :type :both}),
:category "Input",
:added "1.0",
:name millis,
:subcategory "Time & Date",
:type :both,
:processing-name "millis()",
:requires-bindings true,
:link "http://www.processing.org/reference/millis_.html",
:docstring
"Returns the number of milliseconds (thousandths of a second) since\n starting the sketch. This information is often used for timing\n animation sequences.",
:what :fn},
lerp-color
{:args ({:value [c1 c2 amt], :type :both}),
:category "Color",
:added "1.0",
:name lerp-color,
:subcategory "Creating & Reading",
:type :both,
:processing-name "lerpColor()",
:requires-bindings true,
:link "http://www.processing.org/reference/lerpColor_.html",
:docstring
"Calculates a color or colors between two color at a specific\n increment. The amt parameter is the amount to interpolate between\n the two values where 0.0 equal to the first point, 0.1 is very near\n the first point, 0.5 is half-way in between, etc.",
:what :fn},
navigation-2d
{:args ({:value [options], :type :both}),
:category "Middleware",
:added "2.2.6",
:ns "quil.middleware",
:name navigation-2d,
:subcategory nil,
:type :both,
:requires-bindings false,
:link nil,
:docstring
"Enables navigation over 2D sketch. Drag mouse to change the center of the\n sketch and mouse wheel controls zoom. This middleware requires fun-mode.\n\n Customization\n\n You can customize this middleware by providing map as\n :navigation-2d option in defsketch/sketch. Map can have following\n optional keys:\n\n :position - vector of 2 numbers, x and y - center of the screen.\n Default is width/2, height/2.\n\n :zoom - number indicating current zoom level. Default is 1.\n\n Accessing position information from sketch\n\n navigation-2d uses fun-mode under the hood so all position-related\n information is stored in the state map. It means that you can access in\n draw/update/any handler and modify it if you need to. Position\n information is a map which is stored under :navigation-2d key in the\n state map. Position consists of 2 values: :position and :zoom.\n See \"Customization\" section above for more details.\n\n Usage example:\n\n (q/defsketch my-sketch\n ...\n :middleware [m/fun-mode m/navigation-2d])\n",
:what :fn},
color-mode
{:args
({:value [mode max], :type :both}
{:value [mode], :type :both}
{:value [mode max-x max-y max-z max-a], :type :both}
{:value [mode max-x max-y max-z], :type :both}),
:category "Color",
:added "1.0",
:name color-mode,
:subcategory "Creating & Reading",
:type :both,
:processing-name "colorMode()",
:requires-bindings true,
:link "http://www.processing.org/reference/colorMode_.html",
:docstring
"Changes the way Processing interprets color data. Available modes\n are :rgb and :hsb.By default, the parameters for fill, stroke,\n background, and color are defined by values between 0 and 255 using\n the :rgb color model. The color-mode fn is used to change the\n numerical range used for specifying colors and to switch color\n systems. For example, calling\n (color-mode :rgb 1.0) will specify that values are specified between\n 0 and 1. The limits for defining colors are altered by setting the\n parameters range1, range2, range3, and range 4.",
:what :fn},
create-image
{:args ({:value [w h format], :type :both}),
:category "Image",
:added "1.0",
:name create-image,
:subcategory nil,
:type :both,
:processing-name "createImage()",
:requires-bindings true,
:link "http://www.processing.org/reference/createImage_.html",
:docstring
"Creates a new PImage (the datatype for storing images). This\n provides a fresh buffer of pixels to play with. Set the size of the\n buffer with the width and height parameters. The format parameter\n defines how the pixels are stored. See the PImage reference for more\n information.\n\n Possible formats: :rgb, :argb, :alpha (grayscale alpha channel)\n\n Prefer using create-image over initialising new PImage instances\n directly.",
:what :fn},
sq
{:args ({:value [a], :type :both}),
:category "Math",
:added "1.0",
:name sq,
:subcategory "Calculation",
:type :both,
:processing-name "sq()",
:requires-bindings false,
:link "http://www.processing.org/reference/sq_.html",
:docstring
"Squares a number (multiplies a number by itself). The result is\n always a positive number, as multiplying two negative numbers always\n yields a positive result. For example, -1 * -1 = 1.",
:what :fn},
height
{:args ({:value [], :type :both}),
:category "Environment",
:added "1.0",
:name height,
:subcategory nil,
:type :both,
:processing-name "getHeight()",
:processing-link nil,
:requires-bindings true,
:link nil,
:docstring
"Height of the display window. The value of height is zero until\n size is called.",
:what :fn},
no-loop
{:args ({:value [], :type :both}),
:category "Structure",
:added "1.0",
:name no-loop,
:subcategory nil,
:type :both,
:processing-name "noLoop()",
:requires-bindings true,
:link "http://www.processing.org/reference/noLoop_.html",
:docstring
"Stops Processing from continuously executing the code within\n draw. If start-loop is called, the code in draw will begin to run\n continuously again. If using no-loop in setup, it should be the last\n line inside the block.\n\n When no-loop is used, it's not possible to manipulate or access the\n screen inside event handling functions such as mouse-pressed or\n key-pressed. Instead, use those functions to call redraw or\n loop which will run draw, which can update the screen\n properly. This means that when no-loop has been called, no drawing\n can happen, and functions like save-frame may not be used.\n\n Note that if the sketch is resized, redraw will be called to\n update the sketch, even after no-oop has been\n specified. Otherwise, the sketch would enter an odd state until\n loop was called.",
:what :fn},
minute
{:args ({:value [], :type :both}),
:category "Input",
:added "1.0",
:name minute,
:subcategory "Time & Date",
:type :both,
:processing-name "minute()",
:requires-bindings false,
:link "http://www.processing.org/reference/minute_.html",
:docstring "Returns the current minute as a value from 0 - 59",
:what :fn},
screen-width
{:args #{[]},
:category "Environment",
:added "1.0",
:name screen-width,
:subcategory nil,
:type :clj,
:processing-name nil,
:requires-bindings false,
:link nil,
:docstring "Returns the width of the main screen in pixels.",
:what :fn},
text
{:args
({:value [s x1 y1 x2 y2], :type :both}
{:value [s x y], :type :both}
{:value [s x y z], :type :both}),
:category "Typography",
:added "1.0",
:name text,
:subcategory "Loading & Displaying",
:type :both,
:processing-name "text()",
:requires-bindings true,
:link "http://www.processing.org/reference/text_.html",
:docstring
"Draws text to the screen in the position specified by the x and y\n parameters and the optional z parameter. A default font will be used\n unless a font is set with the text-font fn. Change the color of the\n text with the fill fn. The text displays in relation to the\n text-align fn, which gives the option to draw to the left, right, and\n center of the coordinates.\n\n The x1, y1, x2 and y2 parameters define a\n rectangular area to display within and may only be used with string\n data. For text drawn inside a rectangle, the coordinates are\n interpreted based on the current rect-mode setting.",
:what :fn},
available-fonts
{:args ({:value [], :type :both}),
:category "Typography",
:added "1.0",
:name available-fonts,
:subcategory "Loading & Displaying",
:type :both,
:processing-name "PFont.list()",
:requires-bindings false,
:link "http://www.processing.org/reference/PFont_list_.html",
:docstring
"A sequence of strings representing the fonts on this system\n available for use.\n\n Because of limitations in Java, not all fonts can be used and some\n might work with one operating system and not others. When sharing a\n sketch with other people or posting it on the web, you may need to\n include a .ttf or .otf version of your font in the data directory of\n the sketch because other people might not have the font installed on\n their computer. Only fonts that can legally be distributed should be\n included with a sketch.",
:what :fn},
clear
{:args #{[]},
:category "Color",
:added "2.4.0",
:name clear,
:subcategory "Setting",
:type :clj,
:processing-name "clear()",
:requires-bindings true,
:link "http://www.processing.org/reference/clear_.html",
:docstring
"Clears the pixels within a buffer. This function only works on\n graphics objects created with the (create-graphics) function meaning\n that you should call it only inside (with-graphics) macro. Unlike\n the main graphics context (the display window), pixels in additional\n graphics areas created with (create-graphics) can be entirely or\n partially transparent. This function clears everything in a graphics\n object to make all of the pixels 100% transparent.",
:what :fn},
binary
{:args
({:value [val], :type :both} {:value [val num-digits], :type :both}),
:category "Data",
:require-binding false,
:added "1.0",
:name binary,
:subcategory "Conversion",
:type :both,
:processing-name "binary()",
:link "http://www.processing.org/reference/binary_.html",
:docstring
"Returns a string representing the binary value of an int, char or\n byte. When converting an int to a string, it is possible to specify\n the number of digits used.",
:what :fn},
random-2d
{:args ({:value [], :type :both}),
:category "Math",
:added "2.6",
:name random-2d,
:subcategory "Random",
:type :both,
:processing-name "random2d()",
:requires-bindings true,
:link "http://www.processing.org/reference/random2d_.html",
:docstring "Returns a new 2D unit vector in a random direction",
:what :fn},
pop-matrix
{:args ({:value [], :type :both}),
:category "Transform",
:added "1.0",
:name pop-matrix,
:subcategory nil,
:type :both,
:processing-name "popMatrix()",
:requires-bindings true,
:link "http://www.processing.org/reference/popMatrix_.html",
:docstring
"Pops the current transformation matrix off the matrix\n stack. Understanding pushing and popping requires understanding the\n concept of a matrix stack. The push-matrix fn saves the current\n coordinate system to the stack and pop-matrix restores the prior\n coordinate system. push-matrix and pop-matrix are used in conjuction\n with the other transformation methods and may be embedded to control\n the scope of the transformations.",
:what :fn},
ceil
{:args ({:value [n], :type :both}),
:category "Math",
:added "1.0",
:name ceil,
:subcategory "Calculation",
:type :both,
:processing-name "ceil()",
:requires-bindings false,
:link "http://www.processing.org/reference/ceil_.html",
:docstring
"Calculates the closest int value that is greater than or equal to\n the value of the parameter. For example, (ceil 9.03) returns the\n value 10.",
:what :fn},
abs-int
{:args #{[n]},
:category "Math",
:added "1.0",
:name abs-int,
:subcategory "Calculation",
:type :clj,
:processing-name "abs()",
:requires-bindings false,
:link "http://www.processing.org/reference/abs_.html",
:docstring
"Calculates the absolute value (magnitude) of a number. The absolute\n value of a number is always positive. Takes and returns an int.",
:what :fn},
key-code
{:args ({:value [], :type :both}),
:category "Input",
:added "1.0",
:name key-code,
:subcategory "Keyboard",
:type :both,
:processing-name "keyCode",
:requires-bindings true,
:link "http://www.processing.org/reference/keyCode.html",
:docstring
"The variable keyCode is used to detect special keys such as the UP,\n DOWN, LEFT, RIGHT arrow keys and ALT, CONTROL, SHIFT. When checking\n for these keys, it's first necessary to check and see if the key is\n coded. This is done with the conditional (= (key) CODED).\n\n The keys included in the ASCII specification (BACKSPACE, TAB, ENTER,\n RETURN, ESC, and DELETE) do not require checking to see if they key\n is coded, and you should simply use the key variable instead of\n key-code If you're making cross-platform projects, note that the\n ENTER key is commonly used on PCs and Unix and the RETURN key is\n used instead on Macintosh. Check for both ENTER and RETURN to make\n sure your program will work for all platforms.\n\n For users familiar with Java, the values for UP and DOWN are simply\n shorter versions of Java's KeyEvent.VK_UP and\n KeyEvent.VK_DOWN. Other keyCode values can be found in the Java\n KeyEvent reference.",
:what :fn},
sphere
{:args ({:value [radius], :type :both}),
:category "Shape",
:added "1.0",
:name sphere,
:subcategory "3D Primitives",
:type :both,
:processing-name "sphere()",
:requires-bindings true,
:link "http://www.processing.org/reference/sphere_.html",
:docstring
"Generates a hollow ball made from tessellated triangles.",
:what :fn},
request-image
{:args ({:value [filename], :type :both}),
:category "Image",
:added "1.0",
:name request-image,
:subcategory "Loading & Displaying",
:type :both,
:processing-name "requestImage()",
:requires-bindings true,
:link "http://www.processing.org/reference/requestImage_.html",
:docstring
"This function load images on a separate thread so that your sketch\n does not freeze while images load during setup. While the image is\n loading, its width and height will be 0. If an error occurs while\n loading the image, its width and height will be set to -1. You'll\n know when the image has loaded properly because its width and height\n will be greater than 0. Asynchronous image loading (particularly\n when downloading from a server) can dramatically improve\n performance.",
:what :fn},
hue
{:args ({:value [col], :type :both}),
:category "Color",
:added "1.0",
:name hue,
:subcategory "Creating & Reading",
:type :both,
:processing-name "hue()",
:requires-bindings true,
:link "http://www.processing.org/reference/hue_.html",
:docstring "Extracts the hue value from a color.",
:what :fn},
background-int
{:args
({:value [rgb alpha], :type :both} {:value [rgb], :type :both}),
:category "Color",
:added "1.0",
:name background-int,
:subcategory "Setting",
:type :both,
:processing-name "background()",
:requires-bindings true,
:link "http://www.processing.org/reference/background_.html",
:docstring
"Sets the color used for the background of the Processing\n window. The default background is light gray. In the draw function,\n the background color is used to clear the display window at the\n beginning of each frame.\n\n It is not possible to use transparency (alpha) in background colors\n with the main drawing surface, however they will work properly with\n create-graphics. Converts rgb to an int and alpha to a float.",
:what :fn},
start-loop
{:args ({:value [], :type :both}),
:category "Structure",
:added "1.0",
:name start-loop,
:subcategory nil,
:type :both,
:processing-name "loop()",
:requires-bindings true,
:link "http://www.processing.org/reference/loop_.html",
:docstring
"Causes Processing to continuously execute the code within\n draw. If no-loop is called, the code in draw stops executing.",
:what :fn},
curve-vertex
{:args ({:value [x y], :type :both} {:value [x y z], :type :both}),
:category "Shape",
:added "1.0",
:name curve-vertex,
:subcategory "Vertex",
:type :both,
:processing-name "curveVertex()",
:requires-bindings true,
:link "http://www.processing.org/reference/curveVertex_.html",
:docstring
"Specifies vertex coordinates for curves. This function may only be\n used between begin-shape and end-shape and only when there is no\n mode keyword specified to begin-shape. The first and last points in a\n series of curve-vertex lines will be used to guide the beginning and\n end of a the curve. A minimum of four points is required to draw a\n tiny curve between the second and third points. Adding a fifth point\n with curve-vertex will draw the curve between the second, third, and\n fourth points. The curve-vertex function is an implementation of\n Catmull-Rom splines.",
:what :fn},
constrain-int
{:args #{[amt low high]},
:category "Math",
:added "1.0",
:name constrain-int,
:subcategory "Calculation",
:type :clj,
:processing-name "constrain()",
:requires-bindings false,
:link "http://www.processing.org/reference/constrain_.html",
:docstring
"Constrains a value to not exceed a maximum and minimum value. All\n args are cast to ints.",
:what :fn},
state-atom
{:args ({:value [], :type :both}),
:category "State",
:added "1.0",
:name state-atom,
:subcategory nil,
:type :both,
:requires-bindings true,
:link nil,
:docstring
"Retrieve sketch-specific state-atom. All changes to the\n atom will be reflected in the state.\n\n (set-state! :foo 1)\n (state :foo) ;=> 1\n (swap! (state-atom) update-in [:foo] inc)\n (state :foo) ;=> 2",
:what :fn},
load-image
{:args ({:value [filename], :type :both}),
:category "Image",
:added "1.0",
:name load-image,
:subcategory "Loading & Displaying",
:type :both,
:processing-name "loadImage()",
:requires-bindings true,
:link "http://www.processing.org/reference/loadImage_.html",
:docstring
"Loads an image into a variable of type PImage. Four types of\n images ( .gif, .jpg, .tga, .png) images may be loaded. To load\n correctly, images must be located in the data directory of the\n current sketch. In most cases, load all images in setup to preload\n them at the start of the program. Loading images inside draw will\n reduce the speed of a program.\n\n The filename parameter can also be a URL to a file found online.\n\n If an image is not loaded successfully, the null value is returned\n and an error message will be printed to the console. The error\n message does not halt the program, however the null value may cause\n a NullPointerException if your code does not check whether the value\n returned from load-image is nil.\n\n Depending on the type of error, a PImage object may still be\n returned, but the width and height of the image will be set to\n -1. This happens if bad image data is returned or cannot be decoded\n properly. Sometimes this happens with image URLs that produce a 403\n error or that redirect to a password prompt, because load-image\n will attempt to interpret the HTML as image data.",
:what :fn},
bezier
{:args
({:value [x1 y1 z1 cx1 cy1 cz1 cx2 cy2 cz2 x2 y2 z2], :type :both}
{:value [x1 y1 cx1 cy1 cx2 cy2 x2 y2], :type :both}),
:category "Shape",
:added "1.0",
:name bezier,
:subcategory "Curves",
:type :both,
:processing-name "bezier()",
:requires-bindings true,
:link "http://www.processing.org/reference/bezier_.html",
:docstring
"Draws a Bezier curve on the screen. These curves are defined by a\n series of anchor and control points. The first two parameters\n specify the first anchor point and the last two parameters specify\n the other anchor point. The middle parameters specify the control\n points which define the shape of the curve.",
:what :fn},
smooth
{:args ({:value [level], :type :both} {:value [], :type :both}),
:category "Shape",
:added "1.0",
:name smooth,
:subcategory "Attributes",
:type :both,
:processing-name "smooth()",
:requires-bindings true,
:link "http://www.processing.org/reference/smooth_.html",
:docstring
"Draws all geometry with smooth (anti-aliased) edges. This will slow\n down the frame rate of the application, but will enhance the visual\n refinement.\n\n Must be called inside :settings handler.\n\n The level parameter (int) increases the level of smoothness with the\n P2D and P3D renderers. This is the level of over sampling applied to\n the graphics buffer. The value '2' will double the rendering size\n before scaling it down to the display size. This is called '2x\n anti-aliasing.' The value 4 is used for 4x anti-aliasing and 8 is\n specified for 8x anti-aliasing. If level is set to 0, it will disable\n all smoothing; it's the equivalent of the function noSmooth().\n The maximum anti-aliasing level is determined by the hardware of the\n machine that is running the software.\n\n Note that smooth will also improve image quality of resized images.",
:what :fn},
shear-x
{:args ({:value [angle], :type :both}),
:category "Transform",
:added "1.0",
:name shear-x,
:subcategory nil,
:type :both,
:processing-name "shearX()",
:requires-bindings true,
:link "http://www.processing.org/reference/shearX_.html",
:docstring
"Shears a shape around the x-axis the amount specified by the angle\n parameter. Angles should be specified in radians (values from 0 to\n PI*2) or converted to radians with the radians() function. Objects\n are always sheared around their relative position to the origin and\n positive numbers shear objects in a clockwise direction.\n Transformations apply to everything that happens after and\n subsequent calls to the function accumulates the effect. For\n example, calling (shear-x (/ PI 2)) and then (shear-x (/ PI 2)) is\n the same as (shear-x PI). If shear-x is called within the draw fn,\n the transformation is reset when the loop begins again. This\n function works in P2D or JAVA2D mode.\n\n Technically, shear-x multiplies the current transformation matrix\n by a rotation matrix. This function can be further controlled by the\n push-matrix and pop-matrix fns.",
:what :fn},
stroke-weight
{:args ({:value [weight], :type :both}),
:category "Shape",
:added "1.0",
:name stroke-weight,
:subcategory "Attributes",
:type :both,
:processing-name "strokeWeight()",
:requires-bindings true,
:link "http://www.processing.org/reference/strokeWeight_.html",
:docstring
"Sets the width of the stroke used for lines, points, and the border\n around shapes. All widths are set in units of pixels. ",
:what :fn},
directional-light
{:args ({:value [r g b nx ny nz], :type :both}),
:category "Lights, Camera",
:added "1.0",
:name directional-light,
:subcategory "Lights",
:type :both,
:processing-name "directionalLight()",
:requires-bindings true,
:link "http://www.processing.org/reference/directionalLight_.html",
:docstring
"Adds a directional light. Directional light comes from one\n direction and is stronger when hitting a surface squarely and weaker\n if it hits at a gentle angle. After hitting a surface, a\n directional lights scatters in all directions. Lights need to be\n included in the draw fn to remain persistent in a looping\n program. Placing them in the setup fn of a looping program will cause\n them to only have an effect the first time through the loop. The\n affect of the r, g, and b parameters is determined by the current\n color mode. The nx, ny, and nz parameters specify the direction the\n light is facing. For example, setting ny to -1 will cause the\n geometry to be lit from below (the light is facing directly upward)",
:what :fn},