(rgb: string)
| 81 | } |
| 82 | |
| 83 | function rgbToHex(rgb: string): string | undefined { |
| 84 | const match = rgb.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/) |
| 85 | if (match) { |
| 86 | const [_, rs, gs, bs] = match |
| 87 | return ( |
| 88 | '#' + |
| 89 | componentToHex(parseInt(rs, 10)) + |
| 90 | componentToHex(parseInt(gs, 10)) + |
| 91 | componentToHex(parseInt(bs, 10)) |
| 92 | ) |
| 93 | } |
| 94 | return undefined |
| 95 | } |
| 96 | |
| 97 | async function toEl( |
| 98 | el: string | ElementHandle | Locator, |
no test coverage detected