MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / isResolvedLightTheme

Function isResolvedLightTheme

desktop/runtime-host/theme-service.ts:96–107  ·  view source on GitHub ↗
(
  themeName: string,
  colors: Record<string, string> & { toolPendingBg?: string; userMessageBg?: string },
  exportColors: PiThemeState['exportColors'],
  isLightTheme: (themeName?: string | undefined) => boolean,
)

Source from the content-addressed store, hash-verified

94}
95
96function isResolvedLightTheme(
97 themeName: string,
98 colors: Record<string, string> & { toolPendingBg?: string; userMessageBg?: string },
99 exportColors: PiThemeState['exportColors'],
100 isLightTheme: (themeName?: string | undefined) => boolean,
101) {
102 if (isLightTheme(themeName)) {
103 return true
104 }
105 const background = exportColors.pageBg ?? colors.toolPendingBg ?? colors.userMessageBg
106 return luminance(background) > 0.5
107}
108
109function getThemeEntries(
110 bundledThemeEntries: ReturnType<typeof getBundledThemes>,

Callers 1

loadPiThemeStateInHostFunction · 0.85

Calls 1

luminanceFunction · 0.70

Tested by

no test coverage detected