Closed svgeesus closed 3 years ago
Ah yeah, sorry, looks like I had the commit fixing this sitting in my local copy for a few weeks. Pushed now, apologies for letting you review an old version.
That old version you're looking at is the older complicated syntax, back when we had fallbacks. Now it's much more straightforward, with a colorspace
argument, and then just a numeric channels
array.
In 4.6 CSSColorValue objects, the
CSSColor
constructor is given asThis has several problems.
Firstly, the
colorspace
slot is not named which makes it hard to refer to it; in CSS Color 4 the colorspace parameter tocolor()
is mandatory.Secondly, the
alpha
is also not named, but needs to be so that the varioustoFoo
methods can require that it be filled in. And yes it should be an optional argument.Thirdly, the non-normative comment uses the old syntax with multiple fallbacks. It also uses a colorspace "foo" which is not a dashed ident, nor is it a prefefined colorspace, so Typed OM would currently return a
SyntaxError
. I suggest replacing the comment with/ CSSColor(["display-p3", 0, 1, .5] /
So the constructor should take:
colorspace
r
g
andb
; but that also cuts outxyz
andlab
from being represented. Otherwise, make them a sequence of parametersalpha