( el: string | ElementHandle | Locator, )
| 111 | } |
| 112 | |
| 113 | export async function getColor( |
| 114 | el: string | ElementHandle | Locator, |
| 115 | ): Promise<string> { |
| 116 | el = await toEl(el) |
| 117 | const rgb = await el.evaluate((el) => getComputedStyle(el as Element).color) |
| 118 | return hexToNameMap[rgbToHex(rgb)] ?? rgb |
| 119 | } |
| 120 | |
| 121 | export async function getBg( |
| 122 | el: string | ElementHandle | Locator, |