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

Function toHex

packages/extension/utils/css.ts:210–213  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

208 opacity: number = 1
209): string {
210 const toHex = (n: number) => {
211 const i = Math.min(255, Math.max(0, Math.round(n * 255)))
212 return i.toString(16).padStart(2, '0').toUpperCase()
213 }
214
215 const r = toHex(color.r)
216 const g = toHex(color.g)

Callers 2

formatHexAlphaFunction · 0.70
formatHexFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected