MCPcopy
hub / github.com/opentrace/opentrace / parseHexRgb

Function parseHexRgb

ui/src/components/colors/graphThemeColors.ts:41–48  ·  view source on GitHub ↗
(hex: string)

Source from the content-addressed store, hash-verified

39};
40
41function parseHexRgb(hex: string): { r: number; g: number; b: number } {
42 const h = hex.startsWith('#') ? hex.slice(1) : hex;
43 return {
44 r: parseInt(h.slice(0, 2), 16),
45 g: parseInt(h.slice(2, 4), 16),
46 b: parseInt(h.slice(4, 6), 16),
47 };
48}
49
50let cache: { themeKey: string; colors: GraphThemeColors } | null = null;
51

Callers 1

getGraphThemeColorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected