-
Notifications
You must be signed in to change notification settings - Fork 162
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
Added missing constructors to ImageData facade. #829
Conversation
The ImageData spec references several constructors that scala-js-dom has omitted: https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData
Drawing cues from https://github.com/scala-js/scala-js-dom/blob/main/dom/src/main/scala/org/scalajs/dom/InputEvent.scala#L15C89-L17C1 Don't know what the formatting issue is.
Should we introduce an ImageSettings class? The JS docs just supply them with anonymous arguments: let imageData = new ImageData(200, 100, { colorSpace: "display-p3" }); |
Imported Uint8ClampedArray to reduce verbosity
Yes. Here's an example of how it should be defined. |
OK, I'll try to add that, too. |
Ran scalafmtAll to fix formatting issues. Fixed typo in settings parameter in ImageData constructors.
What about adding a companion object to I mean to store static values for the two types of |
Wouldn't these be better off as an |
Thanks for approving! |
No, they don't. |
Well, in that case, companion object with constants for |
Added the |
… object Added enum PredefinedColorSpace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work, thanks!
The ImageData spec references several constructors that scala-js-dom has omitted:
https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData
This PR means to include these features.