MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / fillColourSchemeSelector

Method fillColourSchemeSelector

static/settings.ts:479–493  ·  view source on GitHub ↗
(colourSchemeSelect: JQuery, theme?: AppTheme)

Source from the content-addressed store, hash-verified

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 (

Callers 2

constructorMethod · 0.95
onThemeChangeMethod · 0.95

Calls 1

isSchemeUsableMethod · 0.95

Tested by

no test coverage detected