MCPcopy
hub / github.com/GitbookIO/gitbook / hexToRgb

Function hexToRgb

packages/colors/src/transformations.ts:88–92  ·  view source on GitHub ↗
(hex: string)

Source from the content-addressed store, hash-verified

86 * Convert a hex color to an RGB color.
87 */
88export function hexToRgb(hex: string): string {
89 const [r, g, b] = hexToRgbArray(hex);
90 // Return the RGB values separated by spaces
91 return `${r} ${g} ${b}`;
92}
93
94/**
95 * Convert a hex color to a RGBA color.

Callers 3

generateShadesFunction · 0.90
CustomizationRootLayoutFunction · 0.90
generateColorVariableFunction · 0.90

Calls 1

hexToRgbArrayFunction · 0.85

Tested by

no test coverage detected