MCPcopy Create free account
hub / github.com/bytebase/bytebase / colorToHex

Function colorToHex

frontend/src/utils/css.ts:40–45  ·  view source on GitHub ↗
(color: Color)

Source from the content-addressed store, hash-verified

38 Math.max(0, Math.min(255, Math.round(channel * 255)));
39
40export const colorToHex = (color: Color): string =>
41 rgbToHex(
42 channelToByte(color.red),
43 channelToByte(color.green),
44 channelToByte(color.blue)
45 );
46
47export const colorToRgbString = (color: Color): string =>
48 [color.red, color.green, color.blue].map(channelToByte).join(" ");

Callers 10

getColorFunction · 0.90
IssueTable.tsxFile · 0.90
resolveAnnouncementThemeFunction · 0.90
resolveWorkspaceThemeFunction · 0.90
convertEnvironmentListFunction · 0.90
ProjectSettingsPageFunction · 0.90
IssueDetailLabelsFunction · 0.90
InlineLabelsFunction · 0.90
css.test.tsFile · 0.90

Calls 2

rgbToHexFunction · 0.85
channelToByteFunction · 0.85

Tested by

no test coverage detected