MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / themeFromOscColor

Function themeFromOscColor

source code/utils/systemTheme.ts:62–68  ·  view source on GitHub ↗
(data: string)

Source from the content-addressed store, hash-verified

60 * Returns undefined for unrecognized formats so callers can fall back.
61 */
62export function themeFromOscColor(data: string): SystemTheme | undefined {
63 const rgb = parseOscRgb(data)
64 if (!rgb) return undefined
65 // ITU-R BT.709 relative luminance. Midpoint split: > 0.5 is light.
66 const luminance = 0.2126 * rgb.r + 0.7152 * rgb.g + 0.0722 * rgb.b
67 return luminance > 0.5 ? 'light' : 'dark'
68}
69
70type Rgb = { r: number; g: number; b: number }
71

Callers

nothing calls this directly

Calls 1

parseOscRgbFunction · 0.85

Tested by

no test coverage detected