Home / Function/ getBgColor() — vite Function Reference

getBgColor() — vite Function Reference

Architecture documentation for the getBgColor() function in test-utils.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  be8a3ff3_0b5f_03cb_da16_42517372d5e5["getBgColor()"]
  c68b21f4_9cd3_3abe_8169_0de2c9650f53["test-utils.ts"]
  be8a3ff3_0b5f_03cb_da16_42517372d5e5 -->|defined in| c68b21f4_9cd3_3abe_8169_0de2c9650f53
  7dacb29d_bf7e_9683_9334_81d5496b7829["toEl()"]
  be8a3ff3_0b5f_03cb_da16_42517372d5e5 -->|calls| 7dacb29d_bf7e_9683_9334_81d5496b7829
  400cd374_f087_fa50_bce1_a6f9b8d57470["rgbToHex()"]
  be8a3ff3_0b5f_03cb_da16_42517372d5e5 -->|calls| 400cd374_f087_fa50_bce1_a6f9b8d57470
  style be8a3ff3_0b5f_03cb_da16_42517372d5e5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

playground/test-utils.ts lines 124–132

export async function getBgColor(
  el: string | ElementHandle | Locator,
): Promise<string> {
  el = await toEl(el)
  const rgb = await el.evaluate(
    (el) => getComputedStyle(el as Element).backgroundColor,
  )
  return hexToNameMap[rgbToHex(rgb)] ?? rgb
}

Domain

Subdomains

Frequently Asked Questions

What does getBgColor() do?
getBgColor() is a function in the vite codebase, defined in playground/test-utils.ts.
Where is getBgColor() defined?
getBgColor() is defined in playground/test-utils.ts at line 124.
What does getBgColor() call?
getBgColor() calls 2 function(s): rgbToHex, toEl.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free