Color.webToColor()

<static> webToColor(web, out) → {object}

Converts a CSS 'web' string into a Phaser Color object.

The web string can be in the format 'rgb(r,g,b)' or 'rgba(r,g,b,a)' where r/g/b are in the range [0..255] and a is in the range [0..1].

Parameters
Name Type Argument Description
web string

The color string in CSS 'web' format.

out object <optional>

An object into which 4 properties will be created: r, g, b and a. If not provided a new object will be created.

Returns
object -

An object with the red, green, blue and alpha values set in the r, g, b and a properties.

Source code: utils/Color.js (Line 608)
doc_phaser
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.