* Parse a CSS color name and set this color to the corresponding r,g,b values * @param cssColor - The CSS color name * @returns Reference to this object for method chaining
(cssColor: string)
| 603 | * @returns Reference to this object for method chaining |
| 604 | */ |
| 605 | parseCSS(cssColor: string) { |
| 606 | const rgb = cssToRGB.get(cssColor as ColorName); |
| 607 | if (!rgb) { |
| 608 | return this.parseRGB(cssColor); |
| 609 | } |
| 610 | return this.setColor(...rgb); |
| 611 | } |
| 612 | |
| 613 | /** |
| 614 | * Parse an RGB or RGBA CSS color string |
no test coverage detected