MCPcopy Create free account
hub / github.com/melonjs/melonJS / parseCSS

Method parseCSS

packages/melonjs/src/math/color.ts:605–611  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 15

constructorMethod · 0.95
copyMethod · 0.95
constructorMethod · 0.80
constructorMethod · 0.80
onResetEventMethod · 0.80
onResetEventMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
onResetEventMethod · 0.80
onResetEventMethod · 0.80
fillStyleMethod · 0.80
clearColorMethod · 0.80

Calls 3

parseRGBMethod · 0.95
setColorMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected