( el: string | ElementHandle | Locator, )
| 145 | } |
| 146 | |
| 147 | export async function getBgColor( |
| 148 | el: string | ElementHandle | Locator, |
| 149 | ): Promise<string> { |
| 150 | el = await toEl(el) |
| 151 | const rgb = await el.evaluate( |
| 152 | (el) => getComputedStyle(el as Element).backgroundColor, |
| 153 | ) |
| 154 | return hexToNameMap[rgbToHex(rgb)] ?? rgb |
| 155 | } |
| 156 | |
| 157 | export function readFile(filename: string, encoding?: BufferEncoding): string |
| 158 | export function readFile(filename: string, encoding: null): Buffer |
no test coverage detected