MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / parseHexNibble

Function parseHexNibble

src/utils/colors.ts:6–9  ·  view source on GitHub ↗
(hex: string)

Source from the content-addressed store, hash-verified

4const clamp255 = (v: number): number => Math.min(255, Math.max(0, v));
5
6const parseHexNibble = (hex: string): number => {
7 const n = Number.parseInt(hex, 16);
8 return Number.isFinite(n) ? n : 0;
9};
10
11const parseHexByte = (hex: string): number => {
12 const n = Number.parseInt(hex, 16);

Callers 1

parseHexColorToRgba01Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected