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

Function getColor

playground/test-utils.ts:113–119  ·  playground/test-utils.ts::getColor
(
  el: string | ElementHandle | Locator,
)

Source from the content-addressed store, hash-verified

111}
112
113export 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
121export async function getBg(
122 el: string | ElementHandle | Locator,

Calls 2

toElFunction · 0.85
rgbToHexFunction · 0.85

Tested by 4

testPageFunction · 0.68
sassTestFunction · 0.68
sassModuleTestsFunction · 0.68
sassOtherTestsFunction · 0.68