@@ -31,11 +31,9 @@ import '../core/friendly_errors/fes_core';
31
31
* let value = alpha(c); // Sets 'value' to 102
32
32
* fill(value);
33
33
* rect(50, 15, 35, 70);
34
+ * describe('Left half of canvas light blue and right half light charcoal grey.');
34
35
* </code>
35
36
* </div>
36
- *
37
- * @alt
38
- * Left half of canvas light blue and right half light charcoal grey.
39
37
*/
40
38
p5 . prototype . alpha = function ( c ) {
41
39
p5 . _validateParameters ( 'alpha' , arguments ) ;
@@ -58,11 +56,10 @@ p5.prototype.alpha = function(c) {
58
56
* let blueValue = blue(c);
59
57
* fill(0, 0, blueValue);
60
58
* rect(50, 20, 35, 60); // Draw right rectangle
59
+ * describe('Left half of canvas light purple and right half a royal blue.');
61
60
* </code>
62
61
* </div>
63
62
*
64
- * @alt
65
- * Left half of canvas light purple and right half a royal blue.
66
63
*/
67
64
p5 . prototype . blue = function ( c ) {
68
65
p5 . _validateParameters ( 'blue' , arguments ) ;
@@ -88,6 +85,8 @@ p5.prototype.blue = function(c) {
88
85
* let value = brightness(c); // Sets 'value' to 255
89
86
* fill(value);
90
87
* rect(50, 20, 35, 60);
88
+ * describe(`Left half of canvas salmon pink and the right half with its
89
+ * brightness colored white.`);
91
90
* </code>
92
91
* </div>
93
92
*
@@ -101,12 +100,10 @@ p5.prototype.blue = function(c) {
101
100
* let value = brightness(c); // A 'value' of 50% is 127.5
102
101
* fill(value);
103
102
* rect(50, 20, 35, 60);
103
+ * describe(`Left half of canvas olive colored and the right half with its
104
+ * brightness color gray.`);
104
105
* </code>
105
106
* </div>
106
- *
107
- * @alt
108
- * Left half of canvas salmon pink and the right half with its brightness colored white.
109
- * Left half of canvas olive colored and the right half with its brightness color gray.
110
107
*/
111
108
p5 . prototype . brightness = function ( c ) {
112
109
p5 . _validateParameters ( 'brightness' , arguments ) ;
@@ -144,6 +141,8 @@ p5.prototype.brightness = function(c) {
144
141
* fill(c);
145
142
* noStroke();
146
143
* rect(30, 20, 55, 55);
144
+ * describe(`Yellow rect in middle right of canvas,
145
+ * with 55 pixel width and height.`);
147
146
* </code>
148
147
* </div>
149
148
*
@@ -157,6 +156,8 @@ p5.prototype.brightness = function(c) {
157
156
* c = color(65);
158
157
* fill(c);
159
158
* ellipse(75, 75, 80, 80);
159
+ * describe(`Yellow ellipse in top left of canvas, black ellipse in bottom
160
+ * right, both 80×80.`);
160
161
* </code>
161
162
* </div>
162
163
*
@@ -167,6 +168,7 @@ p5.prototype.brightness = function(c) {
167
168
* fill(c);
168
169
* noStroke();
169
170
* rect(20, 20, 60, 60);
171
+ * describe('Bright fuchsia rect in middle of canvas, 60 pixel width and height.');
170
172
* </code>
171
173
* </div>
172
174
*
@@ -180,6 +182,7 @@ p5.prototype.brightness = function(c) {
180
182
* c = color('#00ff00');
181
183
* fill(c);
182
184
* rect(55, 10, 45, 80);
185
+ * describe('Two bright green rects on opposite sides of the canvas, both 45×80.');
183
186
* </code>
184
187
* </div>
185
188
*
@@ -201,6 +204,7 @@ p5.prototype.brightness = function(c) {
201
204
* c = color('rgba(0%, 0%, 100%, 1)');
202
205
* fill(c);
203
206
* rect(55, 55, 35, 35); // Draw rectangle
207
+ * describe('Four blue rects in each corner of the canvas, each are 35×35.');
204
208
* </code>
205
209
* </div>
206
210
*
@@ -214,6 +218,8 @@ p5.prototype.brightness = function(c) {
214
218
* c = color('hsla(160, 100%, 50%, 0.5)');
215
219
* fill(c);
216
220
* rect(55, 10, 45, 80); // Draw rectangle
221
+ * describe(`Bright sea green rect on left and darker rect on right of canvas,
222
+ * both 45×80.`);
217
223
* </code>
218
224
* </div>
219
225
*
@@ -227,6 +233,8 @@ p5.prototype.brightness = function(c) {
227
233
* c = color('hsba(160, 100%, 50%, 0.5)');
228
234
* fill(c);
229
235
* rect(55, 10, 45, 80); // Draw rectangle
236
+ * describe(`Dark green rect on left and lighter green rect on right of canvas,
237
+ * both 45×80.`);
230
238
* </code>
231
239
* </div>
232
240
*
@@ -240,18 +248,10 @@ p5.prototype.brightness = function(c) {
240
248
* c = color(50, 55, 100);
241
249
* fill(c);
242
250
* rect(55, 10, 45, 80);
251
+ * describe(`Dark blue rect on left and light teal rect on right of canvas,
252
+ * both 45×80.`);
243
253
* </code>
244
254
* </div>
245
- *
246
- * @alt
247
- * Yellow rect in middle right of canvas, with 55 pixel width and height.
248
- * Yellow ellipse in top left of canvas, black ellipse in bottom right,both 80×80.
249
- * Bright fuchsia rect in middle of canvas, 60 pixel width and height.
250
- * Two bright green rects on opposite sides of the canvas, both 45×80.
251
- * Four blue rects in each corner of the canvas, each are 35×35.
252
- * Bright sea green rect on left and darker rect on right of canvas, both 45×80.
253
- * Dark green rect on left and lighter green rect on right of canvas, both 45×80.
254
- * Dark blue rect on left and light teal rect on right of canvas, both 45×80.
255
255
*/
256
256
257
257
/**
@@ -312,11 +312,10 @@ p5.prototype.color = function() {
312
312
* print(greenValue); // Print "75.0"
313
313
* fill(0, greenValue, 0); // Use 'greenValue' in new fill
314
314
* rect(50, 20, 35, 60); // Draw right rectangle
315
+ * describe(`blue rect on left and green on right, both with black outlines
316
+ * & 35×60.`);
315
317
* </code>
316
318
* </div>
317
- *
318
- * @alt
319
- * blue rect on left and green on right, both with black outlines & 35×60.
320
319
*/
321
320
p5 . prototype . green = function ( c ) {
322
321
p5 . _validateParameters ( 'green' , arguments ) ;
@@ -347,11 +346,10 @@ p5.prototype.green = function(c) {
347
346
* let value = hue(c); // Sets 'value' to "0"
348
347
* fill(value);
349
348
* rect(50, 20, 35, 60);
349
+ * describe('salmon pink rect on left and black on right, both 35×60.');
350
350
* </code>
351
351
* </div>
352
352
*
353
- * @alt
354
- * salmon pink rect on left and black on right, both 35×60.
355
353
*/
356
354
p5 . prototype . hue = function ( c ) {
357
355
p5 . _validateParameters ( 'hue' , arguments ) ;
@@ -394,11 +392,10 @@ p5.prototype.hue = function(c) {
394
392
* rect(50, 20, 20, 60);
395
393
* fill(to);
396
394
* rect(70, 20, 20, 60);
395
+ * describe(`4 rects one tan, brown, brownish purple, purple, with white
396
+ * outlines & 20×60`);
397
397
* </code>
398
398
* </div>
399
- *
400
- * @alt
401
- * 4 rects one tan, brown, brownish purple, purple, with white outlines & 20×60
402
399
*/
403
400
404
401
p5 . prototype . lerpColor = function ( c1 , c2 , amt ) {
@@ -468,11 +465,10 @@ p5.prototype.lerpColor = function(c1, c2, amt) {
468
465
* let value = lightness(c); // Sets 'value' to 50
469
466
* fill(value);
470
467
* rect(50, 20, 35, 60);
468
+ * describe(`light pastel green rect on left and dark grey rect on right,
469
+ * both 35×60.`);
471
470
* </code>
472
471
* </div>
473
- *
474
- * @alt
475
- * light pastel green rect on left and dark grey rect on right, both 35×60.
476
472
*/
477
473
p5 . prototype . lightness = function ( c ) {
478
474
p5 . _validateParameters ( 'lightness' , arguments ) ;
@@ -497,6 +493,8 @@ p5.prototype.lightness = function(c) {
497
493
* print(redValue); // Print "255.0"
498
494
* fill(redValue, 0, 0); // Use 'redValue' in new fill
499
495
* rect(50, 20, 35, 60); // Draw right rectangle
496
+ * describe(`yellow rect on left and red rect on right, both with black
497
+ * outlines and 35×60.`);
500
498
* </code>
501
499
* </div>
502
500
*
@@ -507,12 +505,9 @@ p5.prototype.lightness = function(c) {
507
505
* colorMode(RGB, 1); // Sets the range for red, green, and blue to 1
508
506
* let myColor = red(c);
509
507
* print(myColor); // 0.4980392156862745
508
+ * describe('grey canvas');
510
509
* </code>
511
510
* </div>
512
- *
513
- * @alt
514
- * yellow rect on left and red rect on right, both with black outlines and 35×60.
515
- * grey canvas
516
511
*/
517
512
p5 . prototype . red = function ( c ) {
518
513
p5 . _validateParameters ( 'red' , arguments ) ;
@@ -542,11 +537,9 @@ p5.prototype.red = function(c) {
542
537
* let value = saturation(c); // Sets 'value' to 126
543
538
* fill(value);
544
539
* rect(50, 20, 35, 60);
540
+ * describe('deep pink rect on left and grey rect on right, both 35×60.');
545
541
* </code>
546
542
* </div>
547
- *
548
- * @alt
549
- *deep pink rect on left and grey rect on right, both 35×60.
550
543
*/
551
544
p5 . prototype . saturation = function ( c ) {
552
545
p5 . _validateParameters ( 'saturation' , arguments ) ;
0 commit comments