Skip to content

Commit 1b0aa04

Browse files
authored
fix: prevent miniMapSlider covered by other colors (#448)
* fix: prevent miniMapSlider covered by other colors * chore: improve the sort of colors * fix: improve the inherit of color theme
1 parent d67c2e0 commit 1b0aa04

File tree

5 files changed

+70
-88
lines changed

5 files changed

+70
-88
lines changed

src/extensions/theme-defaults/themes/dark_defaults.json

+31-33
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,56 @@
22
"$schema": "vscode://schemas/color-theme",
33
"name": "Dark Default Colors",
44
"colors": {
5+
"activityBar.foreground": "#fff",
6+
"activityBar.inactiveForeground": "#ffffff66",
7+
"activityBarBadge.background": "#007ACC",
8+
"diffEditor.insertedTextBackground": "#9bb95533",
9+
"diffEditor.removedTextBackground": "#ff000033",
510
"editor.background": "#1E1E1E",
6-
"editor.foreground": "#D4D4D4",
711
"editor.findMatchHighlightBackground": "#EA5C0055",
12+
"editor.foreground": "#D4D4D4",
813
"editor.inactiveSelectionBackground": "#3A3D41",
9-
"editorIndentGuide.background": "#404040",
10-
"editorIndentGuide.activeBackground": "#707070",
1114
"editor.selectionHighlightBackground": "#ADD6FF26",
12-
"editorGroupHeader.tabsBackground": "rgb(37, 37, 38)",
13-
"list.dropBackground": "#383B3D",
14-
"list.activeSelectionBackground": "#094771",
15-
"list.inactiveSelectionBackground": "#37373D",
16-
"list.focusOutline": "#007FD4",
17-
"activityBarBadge.background": "#007ACC",
18-
"activityBar.foreground": "#fff",
19-
"activityBar.inactiveForeground": "#ffffff66",
20-
"sidebarTitle.foreground": "#BBBBBB",
21-
"sideBarSectionHeader.border": "#ccc3",
15+
"editorGroupHeader.tabsBackground": "#252526",
16+
"editorIndentGuide.activeBackground": "#707070",
17+
"editorIndentGuide.background": "#404040",
18+
"icon.foreground": "#C5C5C5",
2219
"input.placeholderForeground": "#A6A6A6",
2320
"inputOption.activeBackground": "#007fd466",
21+
"inputValidation.errorBackground": "#5A1D1D",
22+
"inputValidation.errorBorder": "#BE1100",
2423
"inputValidation.infoBackground": "#063B49",
2524
"inputValidation.infoBorder": "#007acc",
2625
"inputValidation.warningBackground": "#352A05",
2726
"inputValidation.warningBorder": "#B89500",
28-
"inputValidation.errorBackground": "#5A1D1D",
29-
"inputValidation.errorBorder": "#BE1100",
30-
"icon.foreground": "#C5C5C5",
31-
"panelTitle.activeForeground": "#E7E7E7",
32-
"panelTitle.inactiveForeground": "#e7e7e799",
33-
"problemsWarningIcon.foreground": "#CCA700",
34-
"problemsErrorIcon.foreground": "#F48771",
35-
"problemsInfoIcon.foreground": "#75BEFF",
36-
"settings.textInputBackground": "#292929",
37-
"settings.numberInputBackground": "#292929",
27+
"list.activeSelectionBackground": "#094771",
28+
"list.dropBackground": "#383B3D",
29+
"list.focusOutline": "#007FD4",
30+
"list.inactiveSelectionBackground": "#37373D",
3831
"menu.background": "#252526",
3932
"menu.foreground": "#CCCCCC",
4033
"menu.selectionBackground": "#094771",
4134
"menu.separatorBackground": "#BBBBBB",
35+
"minimapSlider.activeBackground": "#bfbfbf66",
4236
"minimapSlider.background": "#79797980",
4337
"minimapSlider.hoverBackground": "#64646480",
44-
"minimapSlider.activeBackground": "#bfbfbf66",
45-
"statusBarItem.remoteForeground": "#FFF",
38+
"panelTitle.activeForeground": "#E7E7E7",
39+
"panelTitle.inactiveForeground": "#e7e7e799",
40+
"problemsErrorIcon.foreground": "#F48771",
41+
"problemsInfoIcon.foreground": "#75BEFF",
42+
"problemsWarningIcon.foreground": "#CCA700",
43+
"settings.numberInputBackground": "#292929",
44+
"settings.textInputBackground": "#292929",
45+
"sideBarSectionHeader.background": "#0000",
46+
"sideBarSectionHeader.border": "#ccc3",
47+
"sideBarTitle.foreground": "#BBBBBB",
4648
"statusBarItem.remoteBackground": "#16825D",
47-
"sidebarSectionHeader.background": "#0000",
48-
"sidebarSectionHeader.border": "#ccc3",
49-
"tab.border": "#252526",
50-
"tab.inactiveBackground": "rgb(45, 45, 45)",
51-
"tab.inactiveForeground": "rgba(255, 255, 255, 0.5)",
49+
"statusBarItem.remoteForeground": "#FFF",
5250
"tab.activeBackground": "#1E1E1E",
5351
"tab.activeForeground": "#fff",
54-
"diffEditor.insertedTextBackground": "#9bb95533",
55-
"diffEditor.removedTextBackground": "#ff000033",
56-
"actionBar.checkedBackground": "rgba(0, 127, 212, 0.4)"
52+
"tab.border": "#252526",
53+
"tab.inactiveBackground": "#2d2d2d",
54+
"tab.inactiveForeground": "#ffffff80"
5755
},
5856
"semanticHighlighting": true
5957
}

src/extensions/theme-defaults/themes/hc_black.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"name": "Dark High Contrast",
44
"include": "./hc_black_defaults.json",
55
"colors": {
6-
"selection.background": "#008000",
76
"editor.selectionBackground": "#FFFFFF",
7+
"selection.background": "#008000",
88
"statusBarItem.remoteBackground": "#00000000"
99
},
1010
"tokenColors": [

src/extensions/theme-defaults/themes/hc_black_defaults.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"colors": {
55
"editor.background": "#000000",
66
"editor.foreground": "#FFFFFF",
7-
"editorIndentGuide.background": "#FFFFFF",
87
"editorIndentGuide.activeBackground": "#FFFFFF",
9-
"statusBarItem.remoteBackground": "#00000000",
10-
"sidebarTitle.foreground": "#FFFFFF"
8+
"editorIndentGuide.background": "#FFFFFF",
9+
"sideBarTitle.foreground": "#FFFFFF",
10+
"statusBarItem.remoteBackground": "#00000000"
1111
},
1212
"settings": [
1313
{

src/extensions/theme-defaults/themes/light_defaults.json

+30-31
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,55 @@
22
"$schema": "vscode://schemas/color-theme",
33
"name": "Light Default Colors",
44
"colors": {
5+
"activityBar.foreground": "#fff",
6+
"activityBar.inactiveForeground": "#ffffff66",
7+
"activityBarBadge.background": "#007ACC",
8+
"diffEditor.insertedTextBackground": "#9bb95533",
9+
"diffEditor.removedTextBackground": "#ff000033",
510
"editor.background": "#FFFFFF",
6-
"editor.foreground": "#000000",
711
"editor.findMatchHighlightBackground": "#EA5C0055",
12+
"editor.foreground": "#000000",
813
"editor.inactiveSelectionBackground": "#E5EBF1",
9-
"editorIndentGuide.background": "#D3D3D3",
10-
"editorIndentGuide.activeBackground": "#939393",
1114
"editor.selectionHighlightBackground": "#ADD6FF80",
15+
"editorIndentGuide.activeBackground": "#939393",
16+
"editorIndentGuide.background": "#D3D3D3",
1217
"editorSuggestWidget.background": "#F3F3F3",
13-
"activityBarBadge.background": "#007ACC",
14-
"activityBar.inactiveForeground": "#ffffff66",
15-
"activityBar.foreground": "#fff",
16-
"sidebarTitle.foreground": "#6F6F6F",
17-
"sideBarSectionHeader.border": "#61616130",
18-
"list.hoverBackground": "#E8E8E8",
19-
"list.activeSelectionBackground": "#0060C0",
20-
"list.inactiveSelectionBackground": "#E4E6F1",
21-
"list.focusOutline": "#0090F1",
18+
"icon.foreground": "#424242",
2219
"input.placeholderForeground": "#767676",
2320
"inputOption.activeBackground": "#007fd466",
21+
"inputValidation.errorBackground": "#F2DEDE",
22+
"inputValidation.errorBorder": "#BE1100",
2423
"inputValidation.infoBackground": "#D6ECF2",
2524
"inputValidation.infoBorder": "#007acc",
2625
"inputValidation.warningBackground": "#F6F5D2",
2726
"inputValidation.warningBorder": "#B89500",
28-
"inputValidation.errorBackground": "#F2DEDE",
29-
"inputValidation.errorBorder": "#BE1100",
30-
"icon.foreground": "#424242",
27+
"list.activeSelectionBackground": "#0060C0",
28+
"list.focusOutline": "#0090F1",
29+
"list.hoverBackground": "#E8E8E8",
30+
"list.inactiveSelectionBackground": "#E4E6F1",
31+
"menu.selectionBackground": "#0060C0",
32+
"menu.separatorBackground": "#888888",
33+
"minimapSlider.activeBackground": "#00000099",
34+
"minimapSlider.background": "#64646480",
35+
"minimapSlider.hoverBackground": "#64646480",
3136
"panelTitle.activeForeground": "#424242",
3237
"panelTitle.inactiveForeground": "#424242bf",
33-
"problemsWarningIcon.foreground": "#BF8803",
3438
"problemsErrorIcon.foreground": "#E51400",
3539
"problemsInfoIcon.foreground": "#75BEFF",
40+
"problemsWarningIcon.foreground": "#BF8803",
3641
"searchEditor.textInputBorder": "#CECECE",
37-
"diffEditor.insertedTextBackground": "#9bb95533",
38-
"diffEditor.removedTextBackground": "#ff000033",
39-
"settings.textInputBorder": "#CECECE",
4042
"settings.numberInputBorder": "#CECECE",
41-
"statusBarItem.remoteForeground": "#FFF",
43+
"settings.textInputBorder": "#CECECE",
44+
"sideBarSectionHeader.background": "#0000",
45+
"sideBarSectionHeader.border": "#61616130",
46+
"sideBarTitle.foreground": "#6F6F6F",
4247
"statusBarItem.remoteBackground": "#16825D",
43-
"sidebarSectionHeader.background": "#0000",
44-
"sidebarSectionHeader.border": "#61616130",
45-
"tab.border": "#f3f3f3",
46-
"menu.selectionBackground": "#0060C0",
47-
"menu.separatorBackground": "#888888",
48-
"minimapSlider.background": "#64646480",
49-
"minimapSlider.hoverBackground": "#64646480",
50-
"minimapSlider.activeBackground": "#00000099",
51-
"tab.inactiveBackground": "rgb(236, 236, 236)",
52-
"tab.inactiveForeground": "rgba(51, 51, 51, 0.7)",
48+
"statusBarItem.remoteForeground": "#FFF",
5349
"tab.activeBackground": "#fffffe",
54-
"tab.activeForeground": "#333333"
50+
"tab.activeForeground": "#333333",
51+
"tab.border": "#f3f3f3",
52+
"tab.inactiveBackground": "#ececec",
53+
"tab.inactiveForeground": "#333333b3"
5554
},
5655
"semanticHighlighting": true
5756
}

src/services/theme/helper.ts

+5-20
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,14 @@ function perfectColors(colors: IColors): IColors {
4242
['minimapSlider.background', 'scrollbarSlider.background'],
4343
['minimapSlider.hoverBackground', 'scrollbarSlider.hoverBackground'],
4444
['minimapSlider.activeBackground', 'scrollbarSlider.activeBackground'],
45-
['panel.background', 'workbenchBackground', 'useBackup'],
45+
['panel.background', 'workbenchBackground'],
4646
];
4747

48-
inheritMap.forEach(
49-
([inheritSourceColor, inheritTargetColor, useBackup]) => {
50-
// The isBackup flag is used to specify when the sourceColor is not defined, so the sourceColor inherits the targetColor directly
51-
if (useBackup) {
52-
if (
53-
nextColors[inheritTargetColor] &&
54-
!nextColors[inheritSourceColor]
55-
) {
56-
nextColors[inheritSourceColor] =
57-
nextColors[inheritTargetColor];
58-
}
59-
// Most of the sourceColors inherit the targetColor directly
60-
} else {
61-
if (nextColors[inheritTargetColor]) {
62-
nextColors[inheritSourceColor] =
63-
nextColors[inheritTargetColor];
64-
}
65-
}
48+
inheritMap.forEach(([inheritSourceColor, inheritTargetColor]) => {
49+
if (!nextColors[inheritSourceColor] && nextColors[inheritTargetColor]) {
50+
nextColors[inheritSourceColor] = nextColors[inheritTargetColor];
6651
}
67-
);
52+
});
6853
return nextColors;
6954
}
7055

0 commit comments

Comments
 (0)