diff --git a/internal/converter/model.go b/internal/converter/model.go deleted file mode 100644 index 9b28bb5..0000000 --- a/internal/converter/model.go +++ /dev/null @@ -1,317 +0,0 @@ -package converter - -type VSCodeUITheme string - -const ( - VSCodeUIThemeDark VSCodeUITheme = "vs-dark" - VSCodeUIThemeLight VSCodeUITheme = "vs" - VSCodeUIThemeHighDark VSCodeUITheme = "hc-black" - VSCodeUIThemeHighLight VSCodeUITheme = "hc-light" -) - -type VSCodeThemeExtension struct { - Name string - Description string - Version string - Themes []VSCodeThemeModel -} - -type VSCodeThemeModel struct { - Name string `json:"name"` - UITheme VSCodeUITheme `json:"-"` - Type ThemeType `json:"type"` - Colors VSCodeColorsJSONModel `json:"colors"` -} - -//nolint:tagliatelle -type VSCodeColorsJSONModel struct { - ActivityBarActiveBorder string `json:"activityBar.activeBorder"` - ActivityBarBackground string `json:"activityBar.background"` - ActivityBarBorder string `json:"activityBar.border"` - ActivityBarForeground string `json:"activityBar.foreground"` - ActivityBarInactiveForeground string `json:"activityBar.inactiveForeground"` - ActivityBarBadgeBackground string `json:"activityBarBadge.background"` - ActivityBarBadgeForeground string `json:"activityBarBadge.foreground"` - BadgeBackground string `json:"badge.background"` - BadgeForeground string `json:"badge.foreground"` - ButtonBackground string `json:"button.background"` - ButtonBorder string `json:"button.border"` - ButtonForeground string `json:"button.foreground"` - ButtonHoverBackground string `json:"button.hoverBackground"` - ButtonSecondaryBackground string `json:"button.secondaryBackground"` - ButtonSecondaryForeground string `json:"button.secondaryForeground"` - ButtonSecondaryHoverBackground string `json:"button.secondaryHoverBackground"` - ChatSlashCommandForeground string `json:"chat.slashCommandForeground"` - ChatEditedFileForeground string `json:"chat.editedFileForeground"` - CheckboxBackground string `json:"checkbox.background"` - CheckboxBorder string `json:"checkbox.border"` - DebugToolBarBackground string `json:"debugToolBar.background"` - DescriptionForeground string `json:"descriptionForeground"` - DropdownBackground string `json:"dropdown.background"` - DropdownBorder string `json:"dropdown.border"` - DropdownForeground string `json:"dropdown.foreground"` - DropdownListBackground string `json:"dropdown.listBackground"` - EditorBackground string `json:"editor.background"` - EditorFindMatchBackground string `json:"editor.findMatchBackground"` - EditorForeground string `json:"editor.foreground"` - EditorGroupBorder string `json:"editorGroup.border"` - EditorGroupHeaderTabsBackground string `json:"editorGroupHeader.tabsBackground"` - EditorGroupHeaderTabsBorder string `json:"editorGroupHeader.tabsBorder"` - EditorGutterAddedBackground string `json:"editorGutter.addedBackground"` - EditorGutterDeletedBackground string `json:"editorGutter.deletedBackground"` - EditorGutterModifiedBackground string `json:"editorGutter.modifiedBackground"` - EditorLineNumberActiveForeground string `json:"editorLineNumber.activeForeground"` - EditorLineNumberForeground string `json:"editorLineNumber.foreground"` - EditorOverviewRulerBorder string `json:"editorOverviewRuler.border"` - EditorWidgetBackground string `json:"editorWidget.background"` - ErrorForeground string `json:"errorForeground"` - FocusBorder string `json:"focusBorder"` - Foreground string `json:"foreground"` - IconForeground string `json:"icon.foreground"` - InputBackground string `json:"input.background"` - InputBorder string `json:"input.border"` - InputForeground string `json:"input.foreground"` - InputPlaceholderForeground string `json:"input.placeholderForeground"` - InputOptionActiveBackground string `json:"inputOption.activeBackground"` - InputOptionActiveBorder string `json:"inputOption.activeBorder"` - KeybindingLabelForeground string `json:"keybindingLabel.foreground"` - MenuBackground string `json:"menu.background"` - MenuSelectionBackground string `json:"menu.selectionBackground"` - NotificationCenterHeaderBackground string `json:"notificationCenterHeader.background"` - NotificationCenterHeaderForeground string `json:"notificationCenterHeader.foreground"` - NotificationsBackground string `json:"notifications.background"` - NotificationsBorder string `json:"notifications.border"` - NotificationsForeground string `json:"notifications.foreground"` - PanelBackground string `json:"panel.background"` - PanelBorder string `json:"panel.border"` - PanelInputBorder string `json:"panelInput.border"` - PanelTitleActiveBorder string `json:"panelTitle.activeBorder"` - PanelTitleActiveForeground string `json:"panelTitle.activeForeground"` - PanelTitleInactiveForeground string `json:"panelTitle.inactiveForeground"` - PeekViewEditorBackground string `json:"peekViewEditor.background"` - PeekViewEditorMatchHighlightBackground string `json:"peekViewEditor.matchHighlightBackground"` - PeekViewResultBackground string `json:"peekViewResult.background"` - PeekViewResultMatchHighlightBackground string `json:"peekViewResult.matchHighlightBackground"` - PickerGroupBorder string `json:"pickerGroup.border"` - ProgressBarBackground string `json:"progressBar.background"` - QuickInputBackground string `json:"quickInput.background"` - QuickInputForeground string `json:"quickInput.foreground"` - SettingsDropdownBackground string `json:"settings.dropdownBackground"` - SettingsDropdownBorder string `json:"settings.dropdownBorder"` - SettingsHeaderForeground string `json:"settings.headerForeground"` - SettingsModifiedItemIndicator string `json:"settings.modifiedItemIndicator"` - SideBarBackground string `json:"sideBar.background"` - SideBarBorder string `json:"sideBar.border"` - SideBarForeground string `json:"sideBar.foreground"` - SideBarSectionHeaderBackground string `json:"sideBarSectionHeader.background"` - SideBarSectionHeaderBorder string `json:"sideBarSectionHeader.border"` - SideBarSectionHeaderForeground string `json:"sideBarSectionHeader.foreground"` - SideBarTitleForeground string `json:"sideBarTitle.foreground"` - StatusBarBackground string `json:"statusBar.background"` - StatusBarBorder string `json:"statusBar.border"` - StatusBarDebuggingBackground string `json:"statusBar.debuggingBackground"` - StatusBarDebuggingForeground string `json:"statusBar.debuggingForeground"` - StatusBarFocusBorder string `json:"statusBar.focusBorder"` - StatusBarForeground string `json:"statusBar.foreground"` - StatusBarNoFolderBackground string `json:"statusBar.noFolderBackground"` - StatusBarItemFocusBorder string `json:"statusBarItem.focusBorder"` - StatusBarItemProminentBackground string `json:"statusBarItem.prominentBackground"` - StatusBarItemRemoteBackground string `json:"statusBarItem.remoteBackground"` - StatusBarItemRemoteForeground string `json:"statusBarItem.remoteForeground"` - TabActiveBackground string `json:"tab.activeBackground"` - TabActiveBorder string `json:"tab.activeBorder"` - TabActiveBorderTop string `json:"tab.activeBorderTop"` - TabActiveForeground string `json:"tab.activeForeground"` - TabSelectedBorderTop string `json:"tab.selectedBorderTop"` - TabBorder string `json:"tab.border"` - TabHoverBackground string `json:"tab.hoverBackground"` - TabInactiveBackground string `json:"tab.inactiveBackground"` - TabInactiveForeground string `json:"tab.inactiveForeground"` - TabUnfocusedActiveBorder string `json:"tab.unfocusedActiveBorder"` - TabUnfocusedActiveBorderTop string `json:"tab.unfocusedActiveBorderTop"` - TabUnfocusedHoverBackground string `json:"tab.unfocusedHoverBackground"` - TerminalForeground string `json:"terminal.foreground"` - TerminalTabActiveBorder string `json:"terminal.tab.activeBorder"` - TextBlockQuoteBackground string `json:"textBlockQuote.background"` - TextBlockQuoteBorder string `json:"textBlockQuote.border"` - TextCodeBlockBackground string `json:"textCodeBlock.background"` - TextLinkActiveForeground string `json:"textLink.activeForeground"` - TextLinkForeground string `json:"textLink.foreground"` - TextPreformatForeground string `json:"textPreformat.foreground"` - TextPreformatBackground string `json:"textPreformat.background"` - TextSeparatorForeground string `json:"textSeparator.foreground"` - TitleBarActiveBackground string `json:"titleBar.activeBackground"` - TitleBarActiveForeground string `json:"titleBar.activeForeground"` - TitleBarBorder string `json:"titleBar.border"` - TitleBarInactiveBackground string `json:"titleBar.inactiveBackground"` - TitleBarInactiveForeground string `json:"titleBar.inactiveForeground"` - WelcomePageTileBackground string `json:"welcomePage.tileBackground"` - WelcomePageProgressForeground string `json:"welcomePage.progress.foreground"` - WidgetBorder string `json:"widget.border"` -} - -type VSCodeColorsModel struct { - Foreground string // #D7D7D7 - SecondaryForeground string // #9D9D9D - Background string // #181818 - SecondaryBackground string // #313131 - BackgroundHighlight string // #0078D4 - PeekHighlightBackground string // #BB800966 - BorderForeground string // #2B2B2B - BorderBackground string // #3C3C3C - EditorForeground string // #CCCCCC - EditorBackground string // #1F1F1F - DeleteForeground string // #F85149 - Border2 string // #616161 - TextLinkForeground string // #4DA3FF - // Uncategorized - ActivityBarInactiveForeground string // #868686 - BadgeForeground string // #F8F8F8 - ButtonHoverBackground string // #026EC1 - ChatSlashCommandForeground string // #40A6FF - ChatEditedFileForeground string // #E2C08D - EditorFindMatchBackground string // #9E6A03 - EditorGutterAddedBackground string // #2EA043 - EditorLineNumberForeground string // #6E7681 - EditorOverviewRulerBorder string // #010409 - EditorWidgetBackground string // #202020 - InputPlaceholderForeground string // #989898 - InputOptionActiveBackground string // #2489DB82 - InputOptionActiveBorder string // #2488DB - QuickInputBackground string // #222222 - StatusBarItemProminentBackground string // #6E768166 - TabSelectedBorderTop string // #6caddf - TextPreformatForeground string // #D0D0D0 - TextSeparatorForeground string // #21262D -} - -//nolint:funlen -func ColorsModelToJSONModel(model ColorsModel) ColorsJSONModel { - foregroundBorder := model.Foreground + "12" - - return &VSCodeColorsJSONModel{ - ButtonForeground: model.Foreground, - SettingsHeaderForeground: model.Foreground, - StatusBarDebuggingForeground: model.Foreground, - StatusBarItemRemoteForeground: model.Foreground, - TabActiveForeground: model.Foreground, - ActivityBarBadgeForeground: model.Foreground, - ActivityBarForeground: model.Foreground, - ButtonBorder: foregroundBorder, - EditorGroupBorder: foregroundBorder, - ActivityBarBackground: model.Background, - DebugToolBarBackground: model.Background, - EditorGroupHeaderTabsBackground: model.Background, - PanelBackground: model.Background, - SideBarBackground: model.Background, - SideBarSectionHeaderBackground: model.Background, - StatusBarBackground: model.Background, - TabInactiveBackground: model.Background, - TitleBarActiveBackground: model.Background, - DropdownListBackground: model.EditorBackground, - EditorBackground: model.EditorBackground, - MenuBackground: model.EditorBackground, - NotificationCenterHeaderBackground: model.EditorBackground, - NotificationsBackground: model.EditorBackground, - PeekViewEditorBackground: model.EditorBackground, - PeekViewResultBackground: model.EditorBackground, - StatusBarNoFolderBackground: model.EditorBackground, - TabActiveBackground: model.EditorBackground, - TabActiveBorder: model.EditorBackground, - TabHoverBackground: model.EditorBackground, - TabUnfocusedActiveBorder: model.EditorBackground, - TabUnfocusedHoverBackground: model.EditorBackground, - TitleBarInactiveBackground: model.EditorBackground, - ButtonSecondaryForeground: model.EditorForeground, - DropdownForeground: model.EditorForeground, - EditorForeground: model.EditorForeground, - EditorLineNumberActiveForeground: model.EditorForeground, - Foreground: model.EditorForeground, - IconForeground: model.EditorForeground, - InputForeground: model.EditorForeground, - KeybindingLabelForeground: model.EditorForeground, - NotificationCenterHeaderForeground: model.EditorForeground, - NotificationsForeground: model.EditorForeground, - PanelTitleActiveForeground: model.EditorForeground, - QuickInputForeground: model.EditorForeground, - SideBarForeground: model.EditorForeground, - SideBarSectionHeaderForeground: model.EditorForeground, - StatusBarForeground: model.EditorForeground, - TerminalForeground: model.EditorForeground, - TitleBarActiveForeground: model.EditorForeground, - SideBarTitleForeground: model.EditorForeground, - ButtonSecondaryBackground: model.SecondaryBackground, - CheckboxBackground: model.SecondaryBackground, - DropdownBackground: model.SecondaryBackground, - InputBackground: model.SecondaryBackground, - SettingsDropdownBackground: model.SecondaryBackground, - WidgetBorder: model.SecondaryBackground, - ActivityBarBorder: model.BorderForeground, - EditorGroupHeaderTabsBorder: model.BorderForeground, - NotificationsBorder: model.BorderForeground, - PanelBorder: model.BorderForeground, - PanelInputBorder: model.BorderForeground, - SideBarBorder: model.BorderForeground, - SideBarSectionHeaderBorder: model.BorderForeground, - StatusBarBorder: model.BorderForeground, - TabBorder: model.BorderForeground, - TabUnfocusedActiveBorderTop: model.BorderForeground, - TextBlockQuoteBackground: model.BorderForeground, - TextCodeBlockBackground: model.BorderForeground, - TitleBarBorder: model.BorderForeground, - WelcomePageTileBackground: model.BorderForeground, - ActivityBarActiveBorder: model.BackgroundHighlight, - ActivityBarBadgeBackground: model.BackgroundHighlight, - ButtonBackground: model.BackgroundHighlight, - EditorGutterModifiedBackground: model.BackgroundHighlight, - FocusBorder: model.BackgroundHighlight, - MenuSelectionBackground: model.BackgroundHighlight, - PanelTitleActiveBorder: model.BackgroundHighlight, - ProgressBarBackground: model.BackgroundHighlight, - StatusBarDebuggingBackground: model.BackgroundHighlight, - StatusBarFocusBorder: model.BackgroundHighlight, - StatusBarItemFocusBorder: model.BackgroundHighlight, - StatusBarItemRemoteBackground: model.BackgroundHighlight, - TabActiveBorderTop: model.BackgroundHighlight, - TerminalTabActiveBorder: model.BackgroundHighlight, - WelcomePageProgressForeground: model.BackgroundHighlight, - ButtonSecondaryHoverBackground: model.Background, - CheckboxBorder: model.BorderBackground, - DropdownBorder: model.BorderBackground, - InputBorder: model.BorderBackground, - PickerGroupBorder: model.BorderBackground, - SettingsDropdownBorder: model.BorderBackground, - TextPreformatBackground: model.BorderBackground, - DescriptionForeground: model.SecondaryForeground, - PanelTitleInactiveForeground: model.SecondaryForeground, - TabInactiveForeground: model.SecondaryForeground, - TitleBarInactiveForeground: model.SecondaryForeground, - EditorGutterDeletedBackground: model.DeleteForeground, - ErrorForeground: model.DeleteForeground, - PeekViewEditorMatchHighlightBackground: model.PeekHighlightBackground, - PeekViewResultMatchHighlightBackground: model.PeekHighlightBackground, - SettingsModifiedItemIndicator: model.PeekHighlightBackground, - BadgeBackground: model.Border2, - TextBlockQuoteBorder: model.Border2, - TextLinkActiveForeground: model.TextLinkForeground, - TextLinkForeground: model.TextLinkForeground, - ActivityBarInactiveForeground: model.ActivityBarInactiveForeground, - BadgeForeground: model.BadgeForeground, - ButtonHoverBackground: model.ButtonHoverBackground, - ChatSlashCommandForeground: model.ChatSlashCommandForeground, - ChatEditedFileForeground: model.ChatEditedFileForeground, - EditorFindMatchBackground: model.EditorFindMatchBackground, - EditorGutterAddedBackground: model.EditorGutterAddedBackground, - EditorLineNumberForeground: model.EditorLineNumberForeground, - EditorOverviewRulerBorder: model.EditorOverviewRulerBorder, - EditorWidgetBackground: model.EditorWidgetBackground, - InputPlaceholderForeground: model.InputPlaceholderForeground, - InputOptionActiveBackground: model.InputOptionActiveBackground, - InputOptionActiveBorder: model.InputOptionActiveBorder, - QuickInputBackground: model.QuickInputBackground, - StatusBarItemProminentBackground: model.StatusBarItemProminentBackground, - TabSelectedBorderTop: model.TabSelectedBorderTop, - TextPreformatForeground: model.TextPreformatForeground, - TextSeparatorForeground: model.TextSeparatorForeground, - } -} diff --git a/internal/converter/model/vscode.go b/internal/converter/model/vscode.go new file mode 100644 index 0000000..4e7a693 --- /dev/null +++ b/internal/converter/model/vscode.go @@ -0,0 +1,399 @@ +package model + +type VSCodeUITheme string + +const ( + VSCodeUIThemeDark VSCodeUITheme = "vs-dark" + VSCodeUIThemeLight VSCodeUITheme = "vs" + VSCodeUIThemeHighDark VSCodeUITheme = "hc-black" + VSCodeUIThemeHighLight VSCodeUITheme = "hc-light" +) + +type VSCodeThemeExtension struct { + Name string + Description string + Version string + Themes []VSCodeThemeModel +} + +type VSCodeThemeModel struct { + Name string `json:"name"` + UITheme VSCodeUITheme `json:"-"` + Type ThemeType `json:"type"` + Colors VSCodeColorsJSONModel `json:"colors"` +} + +//nolint:tagliatelle +type VSCodeColorsJSONModel struct { + ActivityBarActiveBorder string `json:"activityBar.activeBorder"` + ActivityBarBackground string `json:"activityBar.background"` + ActivityBarBorder string `json:"activityBar.border"` + ActivityBarForeground string `json:"activityBar.foreground"` + ActivityBarInactiveForeground string `json:"activityBar.inactiveForeground"` + ActivityBarBadgeBackground string `json:"activityBarBadge.background"` + ActivityBarBadgeForeground string `json:"activityBarBadge.foreground"` + BadgeBackground string `json:"badge.background"` + BadgeForeground string `json:"badge.foreground"` + ButtonBackground string `json:"button.background"` + ButtonBorder string `json:"button.border"` + ButtonForeground string `json:"button.foreground"` + ButtonHoverBackground string `json:"button.hoverBackground"` + ButtonSecondaryBackground string `json:"button.secondaryBackground"` + ButtonSecondaryForeground string `json:"button.secondaryForeground"` + ButtonSecondaryHoverBackground string `json:"button.secondaryHoverBackground"` + ChatSlashCommandBackground string `json:"chat.slashCommandBackground"` + ChatSlashCommandForeground string `json:"chat.slashCommandForeground"` + ChatEditedFileForeground string `json:"chat.editedFileForeground"` + CheckboxBackground string `json:"checkbox.background"` + CheckboxBorder string `json:"checkbox.border"` + DebugToolBarBackground string `json:"debugToolBar.background"` + DescriptionForeground string `json:"descriptionForeground"` + DropdownBackground string `json:"dropdown.background"` + DropdownBorder string `json:"dropdown.border"` + DropdownForeground string `json:"dropdown.foreground"` + DropdownListBackground string `json:"dropdown.listBackground"` + EditorBackground string `json:"editor.background"` + EditorFindMatchBackground string `json:"editor.findMatchBackground"` + EditorForeground string `json:"editor.foreground"` + EditorGroupBorder string `json:"editorGroup.border"` + EditorGroupHeaderTabsBackground string `json:"editorGroupHeader.tabsBackground"` + EditorGroupHeaderTabsBorder string `json:"editorGroupHeader.tabsBorder"` + EditorGutterAddedBackground string `json:"editorGutter.addedBackground"` + EditorGutterDeletedBackground string `json:"editorGutter.deletedBackground"` + EditorGutterModifiedBackground string `json:"editorGutter.modifiedBackground"` + EditorLineNumberActiveForeground string `json:"editorLineNumber.activeForeground"` + EditorLineNumberForeground string `json:"editorLineNumber.foreground"` + EditorOverviewRulerBorder string `json:"editorOverviewRuler.border"` + EditorWidgetBackground string `json:"editorWidget.background"` + ErrorForeground string `json:"errorForeground"` + FocusBorder string `json:"focusBorder"` + Foreground string `json:"foreground"` + IconForeground string `json:"icon.foreground"` + InputBackground string `json:"input.background"` + InputBorder string `json:"input.border"` + InputForeground string `json:"input.foreground"` + InputPlaceholderForeground string `json:"input.placeholderForeground"` + InputOptionActiveBackground string `json:"inputOption.activeBackground"` + InputOptionActiveBorder string `json:"inputOption.activeBorder"` + KeybindingLabelForeground string `json:"keybindingLabel.foreground"` + MenuBackground string `json:"menu.background"` + MenuSelectionBackground string `json:"menu.selectionBackground"` + NotificationCenterHeaderBackground string `json:"notificationCenterHeader.background"` + NotificationCenterHeaderForeground string `json:"notificationCenterHeader.foreground"` + NotificationsBackground string `json:"notifications.background"` + NotificationsBorder string `json:"notifications.border"` + NotificationsForeground string `json:"notifications.foreground"` + PanelBackground string `json:"panel.background"` + PanelBorder string `json:"panel.border"` + PanelInputBorder string `json:"panelInput.border"` + PanelTitleActiveBorder string `json:"panelTitle.activeBorder"` + PanelTitleActiveForeground string `json:"panelTitle.activeForeground"` + PanelTitleInactiveForeground string `json:"panelTitle.inactiveForeground"` + PeekViewEditorBackground string `json:"peekViewEditor.background"` + PeekViewEditorMatchHighlightBackground string `json:"peekViewEditor.matchHighlightBackground"` + PeekViewResultBackground string `json:"peekViewResult.background"` + PeekViewResultMatchHighlightBackground string `json:"peekViewResult.matchHighlightBackground"` + PickerGroupBorder string `json:"pickerGroup.border"` + ProgressBarBackground string `json:"progressBar.background"` + QuickInputBackground string `json:"quickInput.background"` + QuickInputForeground string `json:"quickInput.foreground"` + SettingsDropdownBackground string `json:"settings.dropdownBackground"` + SettingsDropdownBorder string `json:"settings.dropdownBorder"` + SettingsHeaderForeground string `json:"settings.headerForeground"` + SettingsModifiedItemIndicator string `json:"settings.modifiedItemIndicator"` + SideBarBackground string `json:"sideBar.background"` + SideBarBorder string `json:"sideBar.border"` + SideBarForeground string `json:"sideBar.foreground"` + SideBarSectionHeaderBackground string `json:"sideBarSectionHeader.background"` + SideBarSectionHeaderBorder string `json:"sideBarSectionHeader.border"` + SideBarSectionHeaderForeground string `json:"sideBarSectionHeader.foreground"` + SideBarTitleForeground string `json:"sideBarTitle.foreground"` + StatusBarBackground string `json:"statusBar.background"` + StatusBarBorder string `json:"statusBar.border"` + StatusBarDebuggingBackground string `json:"statusBar.debuggingBackground"` + StatusBarDebuggingForeground string `json:"statusBar.debuggingForeground"` + StatusBarFocusBorder string `json:"statusBar.focusBorder"` + StatusBarForeground string `json:"statusBar.foreground"` + StatusBarNoFolderBackground string `json:"statusBar.noFolderBackground"` + StatusBarItemFocusBorder string `json:"statusBarItem.focusBorder"` + StatusBarItemProminentBackground string `json:"statusBarItem.prominentBackground"` + StatusBarItemRemoteBackground string `json:"statusBarItem.remoteBackground"` + StatusBarItemRemoteForeground string `json:"statusBarItem.remoteForeground"` + TabActiveBackground string `json:"tab.activeBackground"` + TabActiveBorder string `json:"tab.activeBorder"` + TabActiveBorderTop string `json:"tab.activeBorderTop"` + TabActiveForeground string `json:"tab.activeForeground"` + TabSelectedBorderTop string `json:"tab.selectedBorderTop"` + TabBorder string `json:"tab.border"` + TabHoverBackground string `json:"tab.hoverBackground"` + TabInactiveBackground string `json:"tab.inactiveBackground"` + TabInactiveForeground string `json:"tab.inactiveForeground"` + TabUnfocusedActiveBorder string `json:"tab.unfocusedActiveBorder"` + TabUnfocusedActiveBorderTop string `json:"tab.unfocusedActiveBorderTop"` + TabUnfocusedHoverBackground string `json:"tab.unfocusedHoverBackground"` + TerminalForeground string `json:"terminal.foreground"` + TerminalTabActiveBorder string `json:"terminal.tab.activeBorder"` + TextBlockQuoteBackground string `json:"textBlockQuote.background"` + TextBlockQuoteBorder string `json:"textBlockQuote.border"` + TextCodeBlockBackground string `json:"textCodeBlock.background"` + TextLinkActiveForeground string `json:"textLink.activeForeground"` + TextLinkForeground string `json:"textLink.foreground"` + TextPreformatForeground string `json:"textPreformat.foreground"` + TextPreformatBackground string `json:"textPreformat.background"` + TextSeparatorForeground string `json:"textSeparator.foreground"` + TitleBarActiveBackground string `json:"titleBar.activeBackground"` + TitleBarActiveForeground string `json:"titleBar.activeForeground"` + TitleBarBorder string `json:"titleBar.border"` + TitleBarInactiveBackground string `json:"titleBar.inactiveBackground"` + TitleBarInactiveForeground string `json:"titleBar.inactiveForeground"` + WelcomePageTileBackground string `json:"welcomePage.tileBackground"` + WelcomePageProgressForeground string `json:"welcomePage.progress.foreground"` + WidgetBorder string `json:"widget.border"` + EditorInactiveSelectionBackground string `json:"editor.inactiveSelectionBackground"` + EditorIndentGuideBackground1 string `json:"editorIndentGuide.background1"` + EditorIndentGuideActiveBackground1 string `json:"editorIndentGuide.activeBackground1"` + EditorSelectionHighlightBackground string `json:"editor.selectionHighlightBackground"` + ListDropBackground string `json:"list.dropBackground"` + MenuForeground string `json:"menu.foreground"` + MenuSeparatorBackground string `json:"menu.separatorBackground"` + MenuBorder string `json:"menu.border"` + TabSelectedBackground string `json:"tab.selectedBackground"` + TabSelectedForeground string `json:"tab.selectedForeground"` + TabLastPinnedBorder string `json:"tab.lastPinnedBorder"` + ListActiveSelectionIconForeground string `json:"list.activeSelectionIconForeground"` + TerminalInactiveSelectionBackground string `json:"terminal.inactiveSelectionBackground"` + ActionBarToggledBackground string `json:"actionBar.toggledBackground"` + + TerminalAnsiBlack string `json:"terminal.ansiBlack"` + TerminalAnsiBrightBlack string `json:"terminal.ansiBrightBlack"` + TerminalAnsiBlue string `json:"terminal.ansiBlue"` + TerminalAnsiCyan string `json:"terminal.ansiCyan"` + TerminalAnsiGreen string `json:"terminal.ansiGreen"` + TerminalAnsiBrightBlue string `json:"terminal.ansiBrightBlue"` + TerminalAnsiBrightCyan string `json:"terminal.ansiBrightCyan"` + TerminalAnsiBrightGreen string `json:"terminal.ansiBrightGreen"` + TerminalAnsiWhite string `json:"terminal.ansiWhite"` + TerminalAnsiBrightWhite string `json:"terminal.ansiBrightWhite"` + TerminalAnsiMagenta string `json:"terminal.ansiMagenta"` + TerminalAnsiYellow string `json:"terminal.ansiYellow"` + TerminalAnsiRed string `json:"terminal.ansiRed"` + TerminalAnsiBrightYellow string `json:"terminal.ansiBrightYellow"` + TerminalAnsiBrightMagenta string `json:"terminal.ansiBrightMagenta"` + TerminalAnsiBrightRed string `json:"terminal.ansiBrightRed"` +} + +type VSCodeColorsModel struct { + Foreground string + EditorBackground string + Background string + BackgroundAccent string + WarningForeground string + HiForeground string + Border string + ForegroundAccent string + SecondaryForeground string + SecondaryBackground string + HiBackgroundAccent string + MatchBackground string + + TerminalAnsi TerminalAnsiModel +} + +//nolint:funlen +func VSCodeColorsModelToJSONModel(model *VSCodeColorsModel) *VSCodeColorsJSONModel { + return &VSCodeColorsJSONModel{ + ActivityBarActiveBorder: model.BackgroundAccent, + ActivityBarBadgeBackground: model.BackgroundAccent, + ButtonBackground: model.BackgroundAccent, + EditorGutterModifiedBackground: model.BackgroundAccent, + FocusBorder: model.BackgroundAccent, + PanelTitleActiveBorder: model.BackgroundAccent, + ProgressBarBackground: model.BackgroundAccent, + StatusBarDebuggingBackground: model.BackgroundAccent, + StatusBarFocusBorder: model.BackgroundAccent, + StatusBarItemFocusBorder: model.BackgroundAccent, + StatusBarItemRemoteBackground: model.BackgroundAccent, + TabActiveBorderTop: model.BackgroundAccent, + TerminalTabActiveBorder: model.BackgroundAccent, + WelcomePageProgressForeground: model.BackgroundAccent, + MenuSelectionBackground: model.BackgroundAccent, + + ActivityBarBackground: model.Background, + DebugToolBarBackground: model.Background, + EditorGroupHeaderTabsBackground: model.Background, + PanelBackground: model.Background, + SideBarBackground: model.Background, + SideBarSectionHeaderBackground: model.Background, + StatusBarBackground: model.Background, + TabInactiveBackground: model.Background, + TitleBarActiveBackground: model.Background, + + DropdownListBackground: model.EditorBackground, + EditorBackground: model.EditorBackground, + MenuBackground: model.EditorBackground, + NotificationCenterHeaderBackground: model.EditorBackground, + NotificationsBackground: model.EditorBackground, + PeekViewEditorBackground: model.EditorBackground, + PeekViewResultBackground: model.EditorBackground, + StatusBarNoFolderBackground: model.EditorBackground, + TabActiveBackground: model.EditorBackground, + TabActiveBorder: model.EditorBackground, + TabHoverBackground: model.EditorBackground, + TabUnfocusedActiveBorder: model.EditorBackground, + TabUnfocusedHoverBackground: model.EditorBackground, + TitleBarInactiveBackground: model.EditorBackground, + + ButtonSecondaryForeground: model.Foreground, + DropdownForeground: model.Foreground, + EditorForeground: model.Foreground, + EditorLineNumberActiveForeground: model.Foreground, + Foreground: model.Foreground, + IconForeground: model.Foreground, + InputForeground: model.Foreground, + KeybindingLabelForeground: model.Foreground, + NotificationCenterHeaderForeground: model.Foreground, + NotificationsForeground: model.Foreground, + PanelTitleActiveForeground: model.Foreground, + QuickInputForeground: model.Foreground, + SideBarForeground: model.Foreground, + SideBarSectionHeaderForeground: model.Foreground, + SideBarTitleForeground: model.Foreground, + StatusBarForeground: model.Foreground, + TerminalForeground: model.Foreground, + TitleBarActiveForeground: model.Foreground, + MenuForeground: model.Foreground, + + EditorGutterDeletedBackground: model.WarningForeground, + ErrorForeground: model.WarningForeground, + + BadgeForeground: model.HiForeground, + ListActiveSelectionIconForeground: model.HiForeground, + ActivityBarBadgeForeground: model.HiForeground, + ButtonBorder: model.HiForeground + "12", + ButtonForeground: model.HiForeground, + EditorGroupBorder: model.HiForeground + "17", + SettingsHeaderForeground: model.HiForeground, + StatusBarDebuggingForeground: model.HiForeground, + StatusBarItemRemoteForeground: model.HiForeground, + TabActiveForeground: model.HiForeground, + TabSelectedForeground: model.HiForeground + "a0", + + ActivityBarBorder: model.Border, + EditorGroupHeaderTabsBorder: model.Border, + NotificationsBorder: model.Border, + PanelBorder: model.Border, + PanelInputBorder: model.Border, + SideBarBorder: model.Border, + SideBarSectionHeaderBorder: model.Border, + StatusBarBorder: model.Border, + TabBorder: model.Border, + TabUnfocusedActiveBorderTop: model.Border, + TextBlockQuoteBackground: model.Border, + TextCodeBlockBackground: model.Border, + TitleBarBorder: model.Border, + WelcomePageTileBackground: model.Border, + + ButtonSecondaryBackground: model.Border, + CheckboxBackground: model.Border, + DropdownBackground: model.Border, + InputBackground: model.Border, + SettingsDropdownBackground: model.Border, + WidgetBorder: model.Border, + + ButtonSecondaryHoverBackground: model.Border, + CheckboxBorder: model.Border, + DropdownBorder: model.Border, + InputBorder: model.Border, + PickerGroupBorder: model.Border, + SettingsDropdownBorder: model.Border, + TextPreformatBackground: model.Border, + + EditorOverviewRulerBorder: model.Border, + + EditorWidgetBackground: model.Background, + + TextSeparatorForeground: model.Border, + + QuickInputBackground: model.Background, + TabSelectedBackground: model.Background, + + ChatSlashCommandBackground: model.Background, + + ListDropBackground: model.Background, + + ActionBarToggledBackground: model.Background, + + EditorInactiveSelectionBackground: model.Background, + TerminalInactiveSelectionBackground: model.Background, + + EditorIndentGuideBackground1: model.Background, + + MenuSeparatorBackground: model.SecondaryBackground, + MenuBorder: model.SecondaryBackground, + + BadgeBackground: model.SecondaryBackground, + TextBlockQuoteBorder: model.SecondaryBackground, + + EditorLineNumberForeground: model.SecondaryForeground, + StatusBarItemProminentBackground: model.SecondaryForeground + "66", + + EditorIndentGuideActiveBackground1: model.SecondaryBackground, + + InputPlaceholderForeground: model.SecondaryForeground, + + DescriptionForeground: model.SecondaryForeground, + PanelTitleInactiveForeground: model.SecondaryForeground, + TabInactiveForeground: model.SecondaryForeground, + TitleBarInactiveForeground: model.SecondaryForeground, + + ActivityBarInactiveForeground: model.SecondaryForeground, + + TabLastPinnedBorder: model.Foreground + "33", + + TextPreformatForeground: model.Foreground, + + ActivityBarForeground: model.Foreground, + + ButtonHoverBackground: model.BackgroundAccent, + + InputOptionActiveBorder: model.BackgroundAccent, + + InputOptionActiveBackground: model.BackgroundAccent + "82", + + EditorGutterAddedBackground: model.BackgroundAccent, + + ChatSlashCommandForeground: model.ForegroundAccent, + + TextLinkActiveForeground: model.ForegroundAccent, + TextLinkForeground: model.ForegroundAccent, + + TabSelectedBorderTop: model.ForegroundAccent, + + EditorSelectionHighlightBackground: model.HiBackgroundAccent, + + EditorFindMatchBackground: model.MatchBackground, + + PeekViewEditorMatchHighlightBackground: model.MatchBackground + "aa", + PeekViewResultMatchHighlightBackground: model.MatchBackground + "aa", + SettingsModifiedItemIndicator: model.MatchBackground + "aa", + + ChatEditedFileForeground: model.ForegroundAccent, + + TerminalAnsiBlack: model.TerminalAnsi.TerminalAnsiBlack, + TerminalAnsiBrightBlack: model.TerminalAnsi.TerminalAnsiBrightBlack, + TerminalAnsiBlue: model.TerminalAnsi.TerminalAnsiBlue, + TerminalAnsiCyan: model.TerminalAnsi.TerminalAnsiCyan, + TerminalAnsiGreen: model.TerminalAnsi.TerminalAnsiGreen, + TerminalAnsiBrightBlue: model.TerminalAnsi.TerminalAnsiBrightBlue, + TerminalAnsiBrightCyan: model.TerminalAnsi.TerminalAnsiBrightCyan, + TerminalAnsiBrightGreen: model.TerminalAnsi.TerminalAnsiBrightGreen, + TerminalAnsiWhite: model.TerminalAnsi.TerminalAnsiWhite, + TerminalAnsiBrightWhite: model.TerminalAnsi.TerminalAnsiBrightWhite, + TerminalAnsiMagenta: model.TerminalAnsi.TerminalAnsiMagenta, + TerminalAnsiYellow: model.TerminalAnsi.TerminalAnsiYellow, + TerminalAnsiRed: model.TerminalAnsi.TerminalAnsiRed, + TerminalAnsiBrightYellow: model.TerminalAnsi.TerminalAnsiBrightYellow, + TerminalAnsiBrightMagenta: model.TerminalAnsi.TerminalAnsiBrightMagenta, + TerminalAnsiBrightRed: model.TerminalAnsi.TerminalAnsiBrightRed, + } +} diff --git a/internal/converter/vscode.go b/internal/converter/vscode.go index 81eb58f..4d0fd2d 100644 --- a/internal/converter/vscode.go +++ b/internal/converter/vscode.go @@ -7,6 +7,7 @@ import ( "strings" "text/template" + "github.com/shiron-dev/arcanum-hue/internal/converter/model" "github.com/shiron-dev/arcanum-hue/templates/vscode" ) @@ -18,18 +19,18 @@ func GetVSCodeTheme(cfgPath string, outPath string) error { return err } - themes := []VSCodeThemeModel{} + themes := []model.VSCodeThemeModel{} for _, color := range cfg.Colors { - themes = append(themes, VSCodeThemeModel{ + themes = append(themes, model.VSCodeThemeModel{ Name: color.Name, UITheme: color.VSCodeUITheme, Type: color.Type, - Colors: *VSCodeColorsModelToJSONModel(colorsModelToVSCodeColorsModel(&color.Model)), + Colors: *model.VSCodeColorsModelToJSONModel(colorsModelToVSCodeColorsModel(&color.Model)), }) } - vsCodeExt := &VSCodeThemeExtension{ + vsCodeExt := &model.VSCodeThemeExtension{ Name: cfg.Name, Description: cfg.Description, Version: "0.0.1", @@ -44,7 +45,8 @@ func GetVSCodeTheme(cfgPath string, outPath string) error { return nil } -func makeVSCodeThemeExtension(outPath string, ext VSCodeThemeExtension) error { +//nolint:cyclop +func makeVSCodeThemeExtension(outPath string, ext model.VSCodeThemeExtension) error { if err := os.MkdirAll(path.Join(outPath, "/themes"), WriteFilePerm); err != nil { return err } @@ -54,14 +56,15 @@ func makeVSCodeThemeExtension(outPath string, ext VSCodeThemeExtension) error { } for _, theme := range ext.Themes { - if themeJson, err := json.MarshalIndent(theme, "", " "); err != nil { + themeJSON, err := json.MarshalIndent(theme, "", " ") + if err != nil { + return err + } + + if err := os.WriteFile( + path.Join(outPath, "/themes/"+toKebabCase(theme.Name)+"-color-theme.json"), + themeJSON, WriteFilePerm); err != nil { return err - } else { - if err := os.WriteFile( - path.Join(outPath, "/themes/"+toKebabCase(theme.Name)+"-color-theme.json"), - themeJson, WriteFilePerm); err != nil { - return err - } } } @@ -103,49 +106,28 @@ func templateWithInterface(outPath string, parse string, obj interface{}) error return err } - if readme, err := os.Create(outPath); err != nil { + readme, err := os.Create(outPath) + if err != nil { return err - } else { - if err := tmpl.Execute(readme, obj); err != nil { - return err - } } - return nil + return tmpl.Execute(readme, obj) } -func colorsModelToVSCodeColorsModel(model *ColorsModel) *VSCodeColorsModel { - return &VSCodeColorsModel{ - Foreground: model.Foreground, - SecondaryForeground: model.SecondaryForeground, - Background: model.Background, - SecondaryBackground: model.SecondaryBackground, - BackgroundHighlight: model.BackgroundHighlight, - PeekHighlightBackground: model.PeekHighlightBackground, - BorderForeground: model.BorderForeground, - BorderBackground: model.BorderBackground, - EditorForeground: model.EditorForeground, - EditorBackground: model.EditorBackground, - DeleteForeground: model.DeleteForeground, - Border2: model.Border2, - TextLinkForeground: model.TextLinkForeground, - ActivityBarInactiveForeground: "#868686", - BadgeForeground: "#F8F8F8", - ButtonHoverBackground: "#026EC1", - ChatSlashCommandForeground: "#40A6FF", - ChatEditedFileForeground: "#E2C08D", - EditorFindMatchBackground: "#9E6A03", - EditorGutterAddedBackground: "#2EA043", - EditorLineNumberForeground: "#6E7681", - EditorOverviewRulerBorder: "#010409", - EditorWidgetBackground: "#202020", - InputPlaceholderForeground: "#989898", - InputOptionActiveBackground: "#2489DB82", - InputOptionActiveBorder: "#2488DB", - QuickInputBackground: "#222222", - StatusBarItemProminentBackground: "#6E768166", - TabSelectedBorderTop: "#6caddf", - TextPreformatForeground: "#D0D0D0", - TextSeparatorForeground: "#21262D", +func colorsModelToVSCodeColorsModel(colors *model.ColorsModel) *model.VSCodeColorsModel { + return &model.VSCodeColorsModel{ + Foreground: "", + HiForeground: "", + EditorBackground: "", + SecondaryForeground: "", + Background: "", + BackgroundAccent: "", + WarningForeground: "", + Border: "", + SecondaryBackground: "", + ForegroundAccent: "", + HiBackgroundAccent: "", + MatchBackground: "", + TerminalAnsi: colors.TerminalAnsi, } }