(colors: readonly string[])
| 116 | } |
| 117 | |
| 118 | function buildTheme(colors: readonly string[]) { |
| 119 | const themeSpec: Record<string, { color: string }> = {}; |
| 120 | |
| 121 | colors.forEach((color, index) => { |
| 122 | const selector = `.cm-rainbowBracket-${index}`; |
| 123 | themeSpec[selector] = { color: `${color} !important` }; |
| 124 | themeSpec[`${selector} span`] = { color: `${color} !important` }; |
| 125 | }); |
| 126 | |
| 127 | return EditorView.baseTheme(themeSpec); |
| 128 | } |
| 129 | |
| 130 | export function getRainbowBracketColors( |
| 131 | themeConfig: RainbowBracketThemeConfig = {}, |