Skip to content

P2HDR docs #7728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev-2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/core/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,29 @@ export const VERSION = 'VERSION_WILL_BE_REPLACED_BY_BUILD';

// GRAPHICS RENDERER
/**
* The default, two-dimensional renderer.
* @typedef {unique symbol} P2D
* The default, two-dimensional renderer in p5.js.
*
* Use this when calling <a href="#/p5/createCanvas"> (for example,
* `createCanvas(400, 400, P2D)`) to specify a 2D context.
*
* @typedef {'p2d'} P2D
* @property {P2D} P2D
* @final
*/
export const P2D = 'p2d';

/**
* A high-dynamic-range (HDR) variant of the default, two-dimensional renderer.
*
* When available, this mode can allow for extended color ranges and more
* dynamic color representation. Use it similarly to `P2D`:
* `createCanvas(400, 400, P2DHDR)`.
*
* @typedef {'p2d-hdr'} P2DHDR
* @property {P2DHDR} P2DHDR
* @final
*/

export const P2DHDR = 'p2d-hdr';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll need to add this line back after your comment block to fix the tests -- looks like the error is that this constant is no longer defined.


/**
Expand Down
1 change: 1 addition & 0 deletions src/core/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ function environment(p5, fn){
* - `WEBGL2` whose value is `'webgl2'`,
* - `WEBGL` whose value is `'webgl'`, or
* - `P2D` whose value is `'p2d'`. This is the default for 2D sketches.
* - `P2DHDR` whose value is `'p2d-hdr'` (used for HDR 2D sketches, if available).
*
* See <a href="#/p5/setAttributes">setAttributes()</a> for ways to set the
* WebGL version.
Expand Down