(colourSchemeSelect: JQuery, theme?: AppTheme)
| 477 | } |
| 478 | |
| 479 | private fillColourSchemeSelector(colourSchemeSelect: JQuery, theme?: AppTheme) { |
| 480 | colourSchemeSelect.empty(); |
| 481 | if (theme === 'system') { |
| 482 | if (window.matchMedia('(prefers-color-scheme: dark)').matches) { |
| 483 | theme = themes.dark.id; |
| 484 | } else { |
| 485 | theme = themes.default.id; |
| 486 | } |
| 487 | } |
| 488 | for (const scheme of colour.schemes) { |
| 489 | if (this.isSchemeUsable(scheme, theme)) { |
| 490 | colourSchemeSelect.append($(`<option value="${scheme.name}">${scheme.desc}</option>`)); |
| 491 | } |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | private isSchemeUsable(scheme: ColourSchemeInfo, newTheme?: AppTheme): boolean { |
| 496 | return ( |
no test coverage detected