44 *--------------------------------------------------------------------------------------------*/
55
66import { ITheme , IThemeService } from 'vs/platform/theme/common/themeService' ;
7- import { focusBorder , inputBackground , inputForeground , ColorIdentifier , selectForeground , selectBackground , selectListBackground , selectBorder , inputBorder , foreground , editorBackground , contrastBorder , inputActiveOptionBorder , inputActiveOptionBackground , 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 , listFilterWidgetOutline , listFilterWidgetNoMatchesOutline , listFilterWidgetBackground , editorWidgetBackground , treeIndentGuidesStroke , editorWidgetForeground , simpleCheckboxBackground , simpleCheckboxBorder , simpleCheckboxForeground } from 'vs/platform/theme/common/colorRegistry' ;
7+ import { focusBorder , inputBackground , inputForeground , ColorIdentifier , selectForeground , selectBackground , selectListBackground , selectBorder , inputBorder , foreground , editorBackground , contrastBorder , inputActiveOptionBorder , inputActiveOptionBackground , 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 , listFilterWidgetOutline , listFilterWidgetNoMatchesOutline , listFilterWidgetBackground , editorWidgetBackground , treeIndentGuidesStroke , editorWidgetForeground , simpleCheckboxBackground , simpleCheckboxBorder , simpleCheckboxForeground , ColorValue , resolveColorValue } from 'vs/platform/theme/common/colorRegistry' ;
88import { IDisposable } from 'vs/base/common/lifecycle' ;
99import { Color } from 'vs/base/common/color' ;
1010import { mixin } from 'vs/base/common/objects' ;
@@ -20,7 +20,7 @@ export interface IThemable {
2020}
2121
2222export interface IColorMapping {
23- [ optionsKey : string ] : ColorIdentifier | ColorFunction | undefined ;
23+ [ optionsKey : string ] : ColorValue | undefined ;
2424}
2525
2626export interface IComputedStyles {
@@ -30,11 +30,9 @@ export interface IComputedStyles {
3030export function computeStyles ( theme : ITheme , styleMap : IColorMapping ) : IComputedStyles {
3131 const styles = Object . create ( null ) as IComputedStyles ;
3232 for ( let key in styleMap ) {
33- const value = styleMap [ key as string ] ;
34- if ( typeof value === 'string' ) {
35- styles [ key ] = theme . getColor ( value ) ;
36- } else if ( typeof value === 'function' ) {
37- styles [ key ] = value ( theme ) ;
33+ const value = styleMap [ key ] ;
34+ if ( value ) {
35+ styles [ key ] = resolveColorValue ( value , theme ) ;
3836 }
3937 }
4038
0 commit comments