MCPcopy Index your code
hub / github.com/codeaashu/claude-code / parseRGB

Function parseRGB

src/components/Spinner/utils.ts:70–84  ·  view source on GitHub ↗
(colorStr: string)

Source from the content-addressed store, hash-verified

68const RGB_CACHE = new Map<string, RGBColorType | null>()
69
70export function parseRGB(colorStr: string): RGBColorType | null {
71 const cached = RGB_CACHE.get(colorStr)
72 if (cached !== undefined) return cached
73
74 const match = colorStr.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/)
75 const result = match
76 ? {
77 r: parseInt(match[1]!, 10),
78 g: parseInt(match[2]!, 10),
79 b: parseInt(match[3]!, 10),
80 }
81 : null
82 RGB_CACHE.set(colorStr, result)
83 return result
84}
85

Callers 3

GlimmerMessageFunction · 0.85
SpinnerGlyphFunction · 0.85
FlashingCharFunction · 0.85

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected