Skip to content
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

How to serialize new CSS color functions in canvas? #9939

Closed
Loirooriol opened this issue Nov 17, 2023 · 1 comment
Closed

How to serialize new CSS color functions in canvas? #9939

Loirooriol opened this issue Nov 17, 2023 · 1 comment

Comments

@Loirooriol
Copy link
Contributor

What is the issue with the HTML Standard?

https://html.spec.whatwg.org/multipage/canvas.html#serialisation-of-a-color doesn't seem to take into account the new CSS color functions, color spaces, and such.

<!DOCTYPE html>
<canvas></canvas>
<script>
var canvas = document.querySelector("canvas");
var ctx = canvas.getContext("2d");
ctx.strokeStyle = "color(srgb none 2 -1 / 0.5)";
document.body.textContent = ctx.strokeStyle;
</script>
  • Gecko: rgba(0, 255, 0, 0.5)
  • Blink/WebKit: color(srgb none 2 -1 / 0.5)

Or if I specify lab(51.2345 -13.6271 16.2401):

  • Gecko: #6a805d
  • Blink/WebKit: lab(51.2345 -13.6271 16.2401)

These new colors are defined in https://drafts.csswg.org/css-color-4

@emilio @tiaanl What do you think about aligning with Blink/WebKit, to avoid losing precision?

@Loirooriol
Copy link
Contributor Author

Duplicate of #8917

@Loirooriol Loirooriol closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant