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

Function opaqueSyntaxStyle

packages/opencode/src/cli/cmd/run/theme.ts:192–209  ·  view source on GitHub ↗
(style: SyntaxStyle | undefined, bg: RGBA)

Source from the content-addressed store, hash-verified

190}
191
192function opaqueSyntaxStyle(style: SyntaxStyle | undefined, bg: RGBA): SyntaxStyle | undefined {
193 if (!style) {
194 return undefined
195 }
196
197 return SyntaxStyle.fromStyles(
198 Object.fromEntries(
199 [...style.getAllStyles()].map(([name, value]) => [
200 name,
201 {
202 ...value,
203 fg: value.fg ? blend(value.fg, bg) : value.fg,
204 bg: value.bg ? blend(value.bg, bg) : value.bg,
205 },
206 ]),
207 ),
208 )
209}
210
211function indexedPalette(colors: TerminalColors, size: number = Math.max(colors.palette.length, 16)): RGBA[] {
212 return Array.from({ length: size }, (_, index) => {

Callers 1

mapFunction · 0.85

Calls 1

blendFunction · 0.70

Tested by

no test coverage detected