MCPcopy Index your code
hub / github.com/anomalyco/opencode / quantizeTheme

Function quantizeTheme

packages/opencode/src/cli/cmd/run/theme.ts:476–487  ·  view source on GitHub ↗
(theme: TuiThemeCurrent, indexed: RGBA[])

Source from the content-addressed store, hash-verified

474}
475
476function quantizeTheme(theme: TuiThemeCurrent, indexed: RGBA[]): TuiThemeCurrent {
477 const resolved = Object.fromEntries(
478 Object.entries(theme)
479 .filter(([key]) => key !== "thinkingOpacity")
480 .map(([key, value]) => [key, quantizeColor(indexed, value as RGBA)]),
481 ) as Partial<Record<ThemeColor, RGBA>>
482
483 return {
484 ...(resolved as Record<ThemeColor, RGBA>),
485 thinkingOpacity: theme.thinkingOpacity,
486 }
487}
488
489function splashTheme(theme: TuiThemeCurrent, indexed: RGBA[]): RunSplashTheme {
490 const left = nearestIndexed(indexed, theme.textMuted)

Callers 1

resolveRunThemeFunction · 0.85

Calls 1

quantizeColorFunction · 0.85

Tested by

no test coverage detected