MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / formatHex

Function formatHex

packages/extension/utils/css.ts:1170–1173  ·  view source on GitHub ↗
(r: number, g: number, b: number)

Source from the content-addressed store, hash-verified

1168}
1169
1170function formatHex(r: number, g: number, b: number): string {
1171 const toHex = (n: number) => n.toString(16).padStart(2, '0')
1172 return `#${toHex(r)}${toHex(g)}${toHex(b)}`
1173}
1174
1175export function canonicalizeColor(value: string): string | null {
1176 if (value.startsWith('#')) {

Callers 1

canonicalizeColorFunction · 0.70

Calls 1

toHexFunction · 0.70

Tested by

no test coverage detected