MCPcopy Create free account
hub / github.com/alephdata/aleph / rgbToHex

Function rgbToHex

ui/src/util/reduceTranslucentColor.ts:17–23  ·  view source on GitHub ↗
(rgb: RgbColor)

Source from the content-addressed store, hash-verified

15}
16
17function rgbToHex(rgb: RgbColor): string {
18 const hex = Object.values(rgb)
19 .map((component) => component.toString(16).padStart(2, '0'))
20 .join('');
21
22 return `#${hex}`;
23}
24
25// Calculate the HEX representation for a color as if
26// it was rendered on a white background

Callers 1

reduceTranslucentColorFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected