Added missing constructors to ImageData facade.#829
Added missing constructors to ImageData facade.#829armanbilge merged 13 commits intoscala-js:mainfrom
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
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.