Skip to content

Commit 27aed2d

Browse files
committed
1 parent be402f0 commit 27aed2d

3 files changed

Lines changed: 9 additions & 35 deletions

File tree

src/vs/base/common/color.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -399,22 +399,6 @@ export class Color {
399399
return new Color(new RGBA(r, g, b, a));
400400
}
401401

402-
blend2(c: Color): Color {
403-
const otherRgba = c.rgba;
404-
405-
// Convert to 0..1 opacity
406-
const thisA = this.rgba.a;
407-
const otherA = otherRgba.a;
408-
409-
const totalA = thisA + otherA;
410-
411-
const r = this.rgba.r * thisA / totalA + otherRgba.r * otherA / totalA;
412-
const g = this.rgba.g * thisA / totalA + otherRgba.g * otherA / totalA;
413-
const b = this.rgba.b * thisA / totalA + otherRgba.b * otherA / totalA;
414-
415-
return new Color(new RGBA(r, g, b, 1));
416-
}
417-
418402
flatten(...backgrounds: Color[]): Color {
419403
const background = backgrounds.reduceRight((accumulator, color) => {
420404
return Color._flatten(color, accumulator);

src/vs/platform/theme/common/colorRegistry.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ export const listHighlightForeground = registerColor('list.highlightForeground',
235235
export const listInvalidItemForeground = registerColor('list.invalidItemForeground', { dark: '#B89500', light: '#B89500', hc: '#B89500' }, nls.localize('invalidItemForeground', 'List/Tree foreground color for invalid items, for example an unresolved root in explorer.'));
236236
export const listErrorForeground = registerColor('list.errorForeground', { dark: '#F88070', light: '#B01011', hc: null }, nls.localize('listErrorForeground', 'Foreground color of list items containing errors.'));
237237
export const listWarningForeground = registerColor('list.warningForeground', { dark: '#4d9e4d', light: '#117711', hc: null }, nls.localize('listWarningForeground', 'Foreground color of list items containing warnings.'));
238+
export const listMatchesBackground = registerColor('list.matchesBackground', { light: '#efc1ad', dark: '#653723', hc: Color.black }, nls.localize('listMatchesBackground', 'Background color of the type filter widget in lists and trees.'));
239+
export const listMatchesOutline = registerColor('list.matchesOutline', { dark: Color.transparent, light: Color.transparent, hc: '#f38518' }, nls.localize('listMatchesOutline', 'Outline color of the type filter widget in lists and trees.'));
240+
export const listNoMatchesOutline = registerColor('list.noMatchesOutline', { dark: '#B89500', light: '#B89500', hc: contrastBorder }, nls.localize('listNoMatchesOutline', 'Outline color of the type filter widget in lists and trees, when there are no matches.'));
241+
export const listMatchesShadow = registerColor('list.matchesShadow', { dark: '#000000', light: '#A8A8A8', hc: null }, nls.localize('listMatchesShadow', 'Shadow color of the type filter widget in lists and trees.'));
238242

239243
export const pickerGroupForeground = registerColor('pickerGroup.foreground', { dark: '#3794FF', light: '#0066BF', hc: Color.white }, nls.localize('pickerGroupForeground', "Quick picker color for grouping labels."));
240244
export const pickerGroupBorder = registerColor('pickerGroup.border', { dark: '#3F3F46', light: '#CCCEDB', hc: Color.white }, nls.localize('pickerGroupBorder', "Quick picker color for grouping borders."));
@@ -435,21 +439,6 @@ function lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue,
435439
};
436440
}
437441

438-
export function blend2(transparentColorValue: ColorValue, opaqueColorValue: ColorValue): ColorFunction {
439-
return (theme) => {
440-
let transparentColor = resolveColorValue(transparentColorValue, theme);
441-
let opaqueColor = resolveColorValue(opaqueColorValue, theme);
442-
if (transparentColor && opaqueColor) {
443-
return opaqueColor.blend2(transparentColor);
444-
} else if (transparentColor) {
445-
return transparentColor;
446-
} else if (opaqueColor) {
447-
return opaqueColor;
448-
}
449-
return null;
450-
};
451-
}
452-
453442
// ----- implementation
454443

455444
/**

src/vs/platform/theme/common/styler.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';
7-
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, editorFindMatchHighlight, darken, editorWidgetBackground, blend2 } from 'vs/platform/theme/common/colorRegistry';
7+
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, darken, listMatchesOutline, listNoMatchesOutline, listMatchesShadow, listMatchesBackground } from 'vs/platform/theme/common/colorRegistry';
88
import { IDisposable } from 'vs/base/common/lifecycle';
99
import { Color } from 'vs/base/common/color';
1010
import { mixin } from 'vs/base/common/objects';
@@ -249,9 +249,10 @@ export const defaultListStyles: IColorMapping = {
249249
listFocusOutline: activeContrastBorder,
250250
listSelectionOutline: activeContrastBorder,
251251
listHoverOutline: activeContrastBorder,
252-
listMatchesBackground: blend2(editorFindMatchHighlight, editorWidgetBackground),
253-
listNoMatchesOutline: inputValidationWarningBorder,
254-
listMatchesShadow: widgetShadow
252+
listMatchesBackground,
253+
listMatchesOutline,
254+
listNoMatchesOutline,
255+
listMatchesShadow
255256
};
256257

257258
export interface IButtonStyleOverrides extends IStyleOverrides {

0 commit comments

Comments
 (0)