Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

226
Vistas
How to specify color space for canvas in JavaScript?

What is the default color space used in JS canvas?

How can I change the color space used for rendering an HTML canvas element?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Starting in Chrome version 94, when creating a canvas 2d object, you can now provide an options object argument specifying your desired color space to use ("srgb" or "display-p3"):

let canvas = document.getElementById("myCanvas");
let options = { colorSpace: "display-p3" };
const context = canvas.getContext("2d", options);

Also, note that the default color space used for canvas elements is now officially (rather than conventionally and implicitly) sRGB ("srgb").

You can watch the Chrome YouTube announcement and read its feature specification.
As noted in the YouTube video, this feature is going to be available in Firefox and Safari as well.

Related links:

  • Canvas color space proposal on GitHub
  • HTML color space specification

Thanks to isherwood and Kaiido for their comments.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda