MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / parseUnderlineColor

Function parseUnderlineColor

packages/core/src/widgets/styleUtils.ts:47–55  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

45}
46
47function parseUnderlineColor(value: unknown): Rgb24 | ThemeColor | undefined {
48 const packed = sanitizeRgb(value);
49 if (packed !== undefined) return packed;
50 if (typeof value === "string") {
51 const trimmed = value.trim();
52 if (trimmed.length > 0) return trimmed;
53 }
54 return undefined;
55}
56
57/** Clamp/normalize packed RGB values to 24-bit. */
58export function sanitizeRgb(value: unknown): Rgb24 | undefined {

Callers 1

sanitizeTextStyleFunction · 0.85

Calls 1

sanitizeRgbFunction · 0.85

Tested by

no test coverage detected