MCPcopy Create free account
hub / github.com/codeaashu/claude-code / resolveColor

Function resolveColor

src/components/design-system/ThemedBox.tsx:42–50  ·  view source on GitHub ↗

* Resolves a color value that may be a theme key to a raw Color.

(color: keyof Theme | Color | undefined, theme: Theme)

Source from the content-addressed store, hash-verified

40 * Resolves a color value that may be a theme key to a raw Color.
41 */
42function resolveColor(color: keyof Theme | Color | undefined, theme: Theme): Color | undefined {
43 if (!color) return undefined;
44 // Check if it's a raw color (starts with rgb(, #, ansi256(, or ansi:)
45 if (color.startsWith('rgb(') || color.startsWith('#') || color.startsWith('ansi256(') || color.startsWith('ansi:')) {
46 return color as Color;
47 }
48 // It's a theme key - resolve it
49 return theme[color as keyof Theme] as Color;
50}
51
52/**
53 * Theme-aware Box component that resolves theme color keys to raw colors.

Callers 1

ThemedBoxFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected