This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
ideas:color-object [2014/07/07 17:49] – whitespace tabatkins | ideas:color-object [2014/07/09 19:25] – Add asKeyword(). tabatkins | ||
---|---|---|---|
Line 7: | Line 7: | ||
attribute double a; | attribute double a; | ||
| | ||
- | | + | |
static RGBAColor fromHSLA(double h, double s, double l, optional double a=1); | static RGBAColor fromHSLA(double h, double s, double l, optional double a=1); | ||
static RGBAColor fromHSLA(optional HSLAColorInit color); | static RGBAColor fromHSLA(optional HSLAColorInit color); | ||
| | ||
- | | + | |
static RGBAColor fromHex(octet r, octet g, octet b, optional octet a=255); | static RGBAColor fromHex(octet r, octet g, octet b, optional octet a=255); | ||
static RGBAColor fromHex(optional HexColorInit color); | static RGBAColor fromHex(optional HexColorInit color); | ||
| | ||
- | | + | DOMString? asKeyword(); |
+ | /* Add fromKeyword()? | ||
+ | |||
+ | DOMString toString(optional DOMString type=" | ||
static readonly attribute Map serializationTypes; | static readonly attribute Map serializationTypes; | ||
}; | }; | ||
- | The stringifier | + | The toString() method |
Authors can define their own color formats by adding a fromFoo() to RGBAColor, a toFoo() to RGBAColor.prototype, | Authors can define their own color formats by adding a fromFoo() to RGBAColor, a toFoo() to RGBAColor.prototype, | ||
Line 45: | Line 48: | ||
| | ||
partial interface CSS { | partial interface CSS { | ||
- | | + | |
}; | }; | ||
- | If parseColor | + | parseColor() takes a string containing any CSS color, and returns an RGBAColor for it. If the string isn't parseable as a color, throw a SyntaxError exception. |
- | such as '' | + | |
- | but no el argument | + | The optional second argument is used to resolve colors |
- | throw a XXX error. | + |