MCPcopy
hub / github.com/codeaashu/claude-code / color

Function color

src/components/design-system/color.ts:9–30  ·  view source on GitHub ↗
(
  c: keyof Theme | Color | undefined,
  theme: ThemeName,
  type: ColorType = 'foreground',
)

Source from the content-addressed store, hash-verified

7 * values before delegating to the ink renderer's colorize.
8 */
9export function color(
10 c: keyof Theme | Color | undefined,
11 theme: ThemeName,
12 type: ColorType = 'foreground',
13): (text: string) => string {
14 return text => {
15 if (!c) {
16 return text
17 }
18 // Raw color values bypass theme lookup
19 if (
20 c.startsWith('rgb(') ||
21 c.startsWith('#') ||
22 c.startsWith('ansi256(') ||
23 c.startsWith('ansi:')
24 ) {
25 return colorize(text, c, type)
26 }
27 // Theme key lookup
28 return colorize(text, getTheme(theme)[c as keyof Theme], type)
29 }
30}
31

Callers 15

TextInputFunction · 0.85
getFastIconStringFunction · 0.85
VimTextInputFunction · 0.85
OverridesSelectFunction · 0.85
SandboxSettingsFunction · 0.85
LogoV2Function · 0.85
MCPAgentServerMenuFunction · 0.85
MCPListPanelFunction · 0.85
MCPRemoteServerMenuFunction · 0.85
MCPReconnectFunction · 0.85

Calls 2

getThemeFunction · 0.90
colorizeFunction · 0.50

Tested by

no test coverage detected