Get ui colors working again

This commit is contained in:
Daniel Imms
2017-05-04 09:52:18 -07:00
parent 41f43fa8d2
commit 1a27c53c34
2 changed files with 13 additions and 18 deletions

View File

@@ -67,23 +67,6 @@ export const globalRules: IRuleGenerator[] = [
{ color: s => s.base.foreground, generate: getGlobalSettingGenerator('foreground') }
];
export const colorRules: IRuleGenerator[] = [
{ color: s => s.base.background, generate: getGlobalSettingGenerator('editorBackground') },
{ color: s => s.base.foreground, generate: getGlobalSettingGenerator('editorForeground') },
{ color: s => s.ui.cursor, generate: getGlobalSettingGenerator('editorCaret') },
{ color: s => s.ui.guide, generate: getGlobalSettingGenerator('editorGuide') },
{ color: s => s.ui.invisibles, generate: getGlobalSettingGenerator('editorInvisibles') },
{ color: s => s.ui.findMatchHighlight, generate: getGlobalSettingGenerator('editorFindMatchHighlight') },
{ color: s => s.ui.currentFindMatchHighlight, generate: getGlobalSettingGenerator('editorCurrentFindMatchHighlight') },
{ color: s => s.ui.findRangeHighlight, generate: getGlobalSettingGenerator('editorFindRangeHighlight') },
{ color: s => s.ui.rangeHighlight, generate: getGlobalSettingGenerator('editorRangeHighlight') },
{ color: s => s.ui.selection, generate: getGlobalSettingGenerator('editorSelection') },
{ color: s => s.ui.selectionHighlight, generate: getGlobalSettingGenerator('editorSelectionHighlight') },
{ color: s => s.ui.wordHighlight, generate: getGlobalSettingGenerator('editorWordHighlight') },
{ color: s => s.ui.wordHighlightStrong, generate: getGlobalSettingGenerator('editorWordHighlightStrong') },
{ color: s => s.ui.activeLinkForeground, generate: getGlobalSettingGenerator('editorActiveLinkForeground') },
];
export const tokenRules: IRuleGenerator[] = [
// string: It's important that string is put first so that other scopes can override strings
// within template expressions

View File

@@ -150,26 +150,38 @@ export class VscodeThemeGenerator implements IThemeGenerator {
// editor.background: Editor background color.
theme.colors['editor.background'] = background2;
// editor.foreground: Editor default foreground color.
theme.colors['editor.foreground'] = colorSet.base.foreground;
// editorLineNumber.foreground: Color of editor line numbers.
theme.colors['editorLineNumber.foreground'] = addAlpha('#FFFFFF', 0.3);
// editorCursor.foreground: Color of the editor cursor.
if (colorSet.ui.cursor) theme.colors['editorCursor.foreground'] = colorSet.ui.cursor;
// editor.selectionBackground: Color of the editor selection.
if (colorSet.ui.selection) theme.colors['editor.selectionBackground'] = colorSet.ui.selection;
// editor.selectionHighlightBackground: Color for regions with the same content as the selection.
if (colorSet.ui.selectionHighlight) theme.colors['editor.selectionHighlightBackground'] = colorSet.ui.selectionHighlight;
// editor.inactiveSelectionBackground: Color of the selection in an inactive editor.
// editor.wordHighlightBackground: Background color of a symbol during read-access, like reading a variable.
if (colorSet.ui.wordHighlight) theme.colors['editor.wordHighlightBackground'] = colorSet.ui.wordHighlight;
// editor.wordHighlightStrongBackground: Background color of a symbol during write-access, like writing to a variable.
if (colorSet.ui.wordHighlightStrong) theme.colors['editor.wordHighlightStrongBackground'] = colorSet.ui.wordHighlightStrong;
// editor.findMatchBackground: Color of the current search match.
if (colorSet.ui.currentFindMatchHighlight) theme.colors['editor.findMatchBackground'] = colorSet.ui.currentFindMatchHighlight;
// editor.findMatchHighlightBackground: Color of the other search matches.
if (colorSet.ui.findMatchHighlight) theme.colors['editor.findMatchHighlight'] = colorSet.ui.findMatchHighlight;
// editor.findRangeHighlightBackground: Color the range limiting the search.
if (colorSet.ui.findRangeHighlight) theme.colors['editor.findRangeHighlightBackground'] = colorSet.ui.findRangeHighlight;
// editor.hoverHighlightBackground: Highlight below the word for which a hover is shown.
// editor.lineHighlightBackground: Background color for the highlight of line at the cursor position.
// editor.lineHighlightBorder: Background color for the border around the line at the cursor position.
theme.colors['editor.lineHighlightBorder'] = addAlpha('#FFFFFF', 0.1);
theme.colors['editor.lineHighlightBorder'] = colorSet.ui.rangeHighlight ? colorSet.ui.rangeHighlight : addAlpha('#FFFFFF', 0.1);
// editorLink.activeForeground: Color of active links.
if (colorSet.ui.activeLinkForeground) theme.colors['editorLink.activeForeground'] = colorSet.ui.activeLinkForeground;
// editor.rangeHighlightBackground: Background color of highlighted ranges, like by quick open and find features.
theme.colors['editor.rangeHighlightBackground'] = addAlpha('#FFFFFF', 0.05);
// editorWhitespace.foreground: Color of whitespace characters in the editor.
if (colorSet.ui.invisibles) theme.colors['editorWhitespace.foreground'] = colorSet.ui.invisibles;
// editorIndentGuide.background: Color of the editor indentation guides.
if (colorSet.ui.guide) theme.colors['editorIndentGuide.background'] = colorSet.ui.guide;
// Diff Editor Colors
// diffEditor.insertedTextBackground: Background color for text that got inserted.