Capítulo 145 de 411
splitColor() converts a color string into a [r, g, b] (or [r, g, b, a]) array, accepting rgb(), rgba(), hsl(), hsla(), hex, or named colors.
| Parameter | Type | Description |
|---|---|---|
color | String | color value in any supported format |
hsl | Boolean | pass true to get HSL(A) values instead of RGB(A) |
gsap.utils.splitColor("red"); // [255, 0, 0]
gsap.utils.splitColor("#6fb936"); // [111, 185, 54]
gsap.utils.splitColor("rgba(204, 153, 51, 0.5)"); // [204, 153, 51, 0.5]