| 190 | } |
| 191 | |
| 192 | function 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 | |
| 211 | function indexedPalette(colors: TerminalColors, size: number = Math.max(colors.palette.length, 16)): RGBA[] { |
| 212 | return Array.from({ length: size }, (_, index) => { |