MCPcopy
hub / github.com/vitejs/vite / getBgColor

Function getBgColor

playground/test-utils.ts:147–155  ·  view source on GitHub ↗
(
  el: string | ElementHandle | Locator,
)

Source from the content-addressed store, hash-verified

145}
146
147export 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
157export function readFile(filename: string, encoding?: BufferEncoding): string
158export function readFile(filename: string, encoding: null): Buffer

Callers 2

tests.tsFile · 0.85

Calls 2

toElFunction · 0.85
rgbToHexFunction · 0.85

Tested by

no test coverage detected