@@ -439,6 +439,11 @@ function setting(p5, fn){
439439 * in RGB values. Calling `background(255, 204, 0)` sets the background a bright
440440 * yellow color.
441441 *
442+ * The version of `background()` with four parameters interprets them as RGBA,
443+ * HSBA, or HSLA colors, depending on the current
444+ * <a href="#/p5/colorMode">colorMode()</a>. The last parameter sets the alpha
445+ * (transparency) value.
446+ *
442447 * @method background
443448 * @param {p5.Color } color any value created by the <a href="#/p5/color">color()</a> function
444449 * @chainable
@@ -487,6 +492,19 @@ function setting(p5, fn){
487492 * function setup() {
488493 * createCanvas(100, 100);
489494 *
495+ * // R, G, B, and Alpha values.
496+ * background(255, 0, 0, 128);
497+ *
498+ * describe('A canvas with a semi-transparent red background.');
499+ * }
500+ * </code>
501+ * </div>
502+ *
503+ * <div>
504+ * <code>
505+ * function setup() {
506+ * createCanvas(100, 100);
507+ *
490508 * // Use HSB color.
491509 * colorMode(HSB);
492510 *
@@ -1213,6 +1231,10 @@ function setting(p5, fn){
12131231 * <a href="#/p5/colorMode">colorMode()</a>. The default color space is RGB,
12141232 * with each value in the range from 0 to 255.
12151233 *
1234+ * The version of `fill()` with four parameters interprets them as `RGBA`, `HSBA`,
1235+ * or `HSLA` colors, depending on the current <a href="#/p5/colorMode">colorMode()</a>. The last parameter
1236+ * sets the alpha (transparency) value.
1237+ *
12161238 * @method fill
12171239 * @param {Number } v1 red value if color mode is RGB or hue value if color mode is HSB.
12181240 * @param {Number } v2 green value if color mode is RGB or saturation value if color mode is HSB.
@@ -1257,6 +1279,22 @@ function setting(p5, fn){
12571279 * function setup() {
12581280 * createCanvas(100, 100);
12591281 *
1282+ * background(200);
1283+ *
1284+ * // R, G, B, and Alpha values.
1285+ * fill(255, 0, 0, 128);
1286+ * square(20, 20, 60);
1287+ *
1288+ * describe('A semi-transparent red square with a black outline.');
1289+ * }
1290+ * </code>
1291+ * </div>
1292+ *
1293+ * <div>
1294+ * <code>
1295+ * function setup() {
1296+ * createCanvas(100, 100);
1297+ *
12601298 * background(100);
12611299 *
12621300 * // Use HSB color.
@@ -1551,7 +1589,7 @@ function setting(p5, fn){
15511589 * Sets the color used to draw points, lines, and the outlines of shapes.
15521590 *
15531591 * Calling `stroke(255, 165, 0)` or `stroke('orange')` means all shapes drawn
1554- * after calling `stroke()` will be filled with the color orange. The way
1592+ * after calling `stroke()` will be outlined with the color orange. The way
15551593 * these parameters are interpreted may be changed with the
15561594 * <a href="#/p5/colorMode">colorMode()</a> function.
15571595 *
0 commit comments