A proposal and draft spec for a Color object for the Web Platform, loosely influenced by the Color.js work. Heavily WIP, if you landed here randomly, please move along.
As discussed with @tabatkins, having the iccProfile be part of the ColorSpace API shape means that everything needs to be asynchronous.
Far better to just include a static load() method on ColorSpace that takes a profile URL and resolves to a ColorSpace object with its properties prefilled.
interface ColorSpace {
static Promise<ColorSpace> load(RequestInfo input, optional
RequestInit init = {});
/* same signature as fetch() */
};
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().
As discussed with @tabatkins, having the iccProfile be part of the ColorSpace API shape means that everything needs to be asynchronous.
Far better to just include a static
load()
method onColorSpace
that takes a profile URL and resolves to aColorSpace
object with its properties prefilled.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()
.