Skip to content

Instantly share code, notes, and snippets.

@petamoriken
Created October 18, 2023 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petamoriken/a9158b50dabc9930c20f39938a9b6ef6 to your computer and use it in GitHub Desktop.
Save petamoriken/a9158b50dabc9930c20f39938a9b6ef6 to your computer and use it in GitHub Desktop.
const canvas = document.querySelector("canvas");
const context = canvas.getContext("2d", {
colorSpace: "display-p3",
colorType: "float16", // default: "unorm8"
});
context.fillStyle = "color(display-p3 1 0 0)";
context.fillRect(0, 0, 1, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment