(color: string)
| 130 | * Returns null when parsing fails. |
| 131 | */ |
| 132 | export const parseCssColorToRgba01 = (color: string): Rgba01 | null => { |
| 133 | if (typeof color !== 'string') return null; |
| 134 | const c = color.trim(); |
| 135 | if (c.length === 0) return null; |
| 136 | |
| 137 | const hex = parseHexColorToRgba01(c); |
| 138 | if (hex) return hex; |
| 139 | |
| 140 | const rgb = parseRgbFuncToRgba01(c); |
| 141 | if (rgb) return rgb; |
| 142 | |
| 143 | return null; |
| 144 | }; |
| 145 | |
| 146 | export const parseCssColorToGPUColor = ( |
| 147 | color: string, |
no test coverage detected