Closed svgeesus closed 1 year ago
Also quoting from that issue:
Unfortunately, coordinate names cannot always be determined via the ICC profile, so this may need to include something to set those, and thus, its signature would not necessarily be the same as fetch().
An alternative method signature is to take a Response
, so we can delegate the fetching stuff purely to fetch() and just let you pass the result directly in: ColorSpace.load(await fetch(...))
.
(In addition to taking the profile data directly, if you've cached it or something, presumably as a DOMString
.)
This way, we have the rest of the method signature available to pass in a (possibly reduced?) options argument, so we can set/override coord names and anything else.
My main concern with that is the memory consumption of passing 3MB strings around. But I'm not an expert on that sort of thing.
Note that we could do both:
ColorSpace.load((Response or CSSOMString) resource, reducedOptions options)
Yeah, that was my intention.
Both suggestions are now in the spec.
Noted in passing in another issue