MCPcopy Create free account
hub / github.com/bernaferrari/FigmaToCode / toHex

Function toHex

packages/backend/src/html/builderImpl/htmlColor.ts:91–91  ·  view source on GitHub ↗
(num: number)

Source from the content-addressed store, hash-verified

89 const g = Math.round(color.g * 255);
90 const b = Math.round(color.b * 255);
91 const toHex = (num: number): string => num.toString(16).padStart(2, "0");
92 return `#${toHex(r)}${toHex(g)}${toHex(b)}`.toUpperCase();
93 }
94 const r = numberToFixedString(color.r * 255);

Callers 1

htmlColorFunction · 0.70

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected