File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,29 @@ export const VERSION = 'VERSION_WILL_BE_REPLACED_BY_BUILD';
15
15
16
16
// GRAPHICS RENDERER
17
17
/**
18
- * The default, two-dimensional renderer.
19
- * @typedef {unique symbol } P2D
18
+ * The default, two-dimensional renderer in p5.js.
19
+ *
20
+ * Use this when calling <a href="#/p5/createCanvas"> (for example,
21
+ * `createCanvas(400, 400, P2D)`) to specify a 2D context.
22
+ *
23
+ * @typedef {'p2d' } P2D
20
24
* @property {P2D } P2D
21
25
* @final
22
26
*/
23
27
export const P2D = 'p2d' ;
24
28
29
+ /**
30
+ * A high-dynamic-range (HDR) variant of the default, two-dimensional renderer.
31
+ *
32
+ * When available, this mode can allow for extended color ranges and more
33
+ * dynamic color representation. Use it similarly to `P2D`:
34
+ * `createCanvas(400, 400, P2DHDR)`.
35
+ *
36
+ * @typedef {'p2d-hdr' } P2DHDR
37
+ * @property {P2DHDR } P2DHDR
38
+ * @final
39
+ */
40
+
25
41
export const P2DHDR = 'p2d-hdr' ;
26
42
27
43
/**
Original file line number Diff line number Diff line change @@ -514,6 +514,7 @@ function environment(p5, fn){
514
514
* - `WEBGL2` whose value is `'webgl2'`,
515
515
* - `WEBGL` whose value is `'webgl'`, or
516
516
* - `P2D` whose value is `'p2d'`. This is the default for 2D sketches.
517
+ * - `P2DHDR` whose value is `'p2d-hdr'` (used for HDR 2D sketches, if available).
517
518
*
518
519
* See <a href="#/p5/setAttributes">setAttributes()</a> for ways to set the
519
520
* WebGL version.
You can’t perform that action at this time.
0 commit comments