(theme: Theme)
| 189 | } |
| 190 | |
| 191 | export function getSelectionColor(theme: Theme): {backgroundColorSelection: string; foregroundColorSelection: string} { |
| 192 | let backgroundColorSelection: string; |
| 193 | let foregroundColorSelection: string; |
| 194 | if (theme.selectionColor === 'auto') { |
| 195 | backgroundColorSelection = modifyBackgroundColor({r: 0, g: 96, b: 212}, {...theme, grayscale: 0}); |
| 196 | foregroundColorSelection = modifyForegroundColor({r: 255, g: 255, b: 255}, {...theme, grayscale: 0}); |
| 197 | } else { |
| 198 | const rgb = parseColorWithCache(theme.selectionColor)!; |
| 199 | const hsl = rgbToHSL(rgb); |
| 200 | backgroundColorSelection = theme.selectionColor; |
| 201 | if (hsl.l < 0.5) { |
| 202 | foregroundColorSelection = '#FFF'; |
| 203 | } else { |
| 204 | foregroundColorSelection = '#000'; |
| 205 | } |
| 206 | } |
| 207 | return {backgroundColorSelection, foregroundColorSelection}; |
| 208 | } |
| 209 | |
| 210 | function getModifiedSelectionStyle(theme: Theme) { |
| 211 | const lines: string[] = []; |
no test coverage detected