(value: string)
| 27 | |
| 28 | /** Parses a color from a string value. Throws an error if the string could not be parsed. */ |
| 29 | export function parseColor(value: string): IColor { |
| 30 | let res = RGBColor.parse(value) || HSBColor.parse(value) || HSLColor.parse(value); |
| 31 | if (res) { |
| 32 | return res; |
| 33 | } |
| 34 | |
| 35 | throw new Error('Invalid color value: ' + value); |
| 36 | } |
| 37 | |
| 38 | export function normalizeColor(v: string | IColor): IColor { |
| 39 | if (typeof v === 'string') { |