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

Function isHexColor

frontend/src/react/components/sql-editor/theme/derive.ts:99–99  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

97
98type RGB3 = [number, number, number];
99const isHexColor = (value: string): boolean => /^#[\da-fA-F]{6}$/.test(value);
100const hexToRgb = (h: string): RGB3 => {
101 const x = h.replace("#", "");
102 return [0, 2, 4].map((i) => Number.parseInt(x.slice(i, i + 2), 16)) as RGB3;

Callers 1

validateThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected