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

Function toHex

web/components/tools/AnsiRenderer.tsx:56–57  ·  view source on GitHub ↗
(v: number)

Source from the content-addressed store, hash-verified

54 const g = Math.floor(i / 6) % 6;
55 const r = Math.floor(i / 36);
56 const toHex = (v: number) =>
57 (v === 0 ? 0 : 55 + v * 40).toString(16).padStart(2, "0");
58 return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
59 }
60 // Grayscale ramp

Callers 1

get256ColorFunction · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected