MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / normalizeHexColor

Function normalizeHexColor

src/cm/rainbowBrackets.ts:60–65  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

58}
59
60function normalizeHexColor(value: unknown): string | null {
61 if (typeof value !== "string") return null;
62 const color = value.trim().toLowerCase();
63 if (/^#([\da-f]{3}|[\da-f]{6})$/.test(color)) return color;
64 return null;
65}
66
67function clampLookBehind(value: number | undefined): number {
68 if (!Number.isFinite(value)) return MAX_LOOK_BEHIND;

Callers 1

getRainbowBracketColorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected