diff --git a/Cargo.lock b/Cargo.lock index 903dd125c5..6e26d387e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8872,6 +8872,21 @@ dependencies = [ "util", ] +[[package]] +name = "theme_importer" +version = "0.1.0" +dependencies = [ + "anyhow", + "convert_case 0.6.0", + "gpui2", + "log", + "rust-embed", + "serde", + "simplelog", + "theme2", + "uuid 1.4.1", +] + [[package]] name = "theme_selector" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index ed6e65d479..faae9871f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,6 +93,7 @@ members = [ "crates/text", "crates/theme", "crates/theme2", + "crates/theme_importer", "crates/theme_selector", "crates/ui2", "crates/util", diff --git a/assets/themes/src/vsc/ayu/LICENSE b/assets/themes/src/vsc/ayu/LICENSE new file mode 100644 index 0000000000..97c615481a --- /dev/null +++ b/assets/themes/src/vsc/ayu/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Ike Ku + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/assets/themes/src/vsc/ayu/ayu-dark.json b/assets/themes/src/vsc/ayu/ayu-dark.json new file mode 100644 index 0000000000..71c1da3fa5 --- /dev/null +++ b/assets/themes/src/vsc/ayu/ayu-dark.json @@ -0,0 +1,847 @@ +{ + "type": "dark", + "colors": { + "focusBorder": "#e6b450b3", + "foreground": "#565b66", + "widget.shadow": "#00000080", + "selection.background": "#409fff4d", + "icon.foreground": "#565b66", + "errorForeground": "#d95757", + "descriptionForeground": "#565b66", + "textBlockQuote.background": "#0f131a", + "textLink.foreground": "#e6b450", + "textLink.activeForeground": "#e6b450", + "textPreformat.foreground": "#bfbdb6", + "button.background": "#e6b450", + "button.foreground": "#734d00", + "button.hoverBackground": "#e1af4b", + "button.secondaryBackground": "#565b6633", + "button.secondaryForeground": "#bfbdb6", + "button.secondaryHoverBackground": "#565b6680", + "dropdown.background": "#0d1017", + "dropdown.foreground": "#565b66", + "dropdown.border": "#565b6645", + "input.background": "#0d1017", + "input.border": "#565b6645", + "input.foreground": "#bfbdb6", + "input.placeholderForeground": "#565b6680", + "inputOption.activeBorder": "#e6b4504d", + "inputOption.activeBackground": "#e6b45033", + "inputOption.activeForeground": "#e6b450", + "inputValidation.errorBackground": "#0d1017", + "inputValidation.errorBorder": "#d95757", + "inputValidation.infoBackground": "#0b0e14", + "inputValidation.infoBorder": "#39bae6", + "inputValidation.warningBackground": "#0b0e14", + "inputValidation.warningBorder": "#ffb454", + "scrollbar.shadow": "#1e232b00", + "scrollbarSlider.background": "#565b6666", + "scrollbarSlider.hoverBackground": "#565b6699", + "scrollbarSlider.activeBackground": "#565b66b3", + "badge.background": "#e6b45033", + "badge.foreground": "#e6b450", + "progressBar.background": "#e6b450", + "list.activeSelectionBackground": "#47526640", + "list.activeSelectionForeground": "#bfbdb6", + "list.focusBackground": "#47526640", + "list.focusForeground": "#bfbdb6", + "list.focusOutline": "#47526640", + "list.highlightForeground": "#e6b450", + "list.deemphasizedForeground": "#d95757", + "list.hoverBackground": "#47526640", + "list.inactiveSelectionBackground": "#47526633", + "list.inactiveSelectionForeground": "#565b66", + "list.invalidItemForeground": "#565b664d", + "list.errorForeground": "#d95757", + "tree.indentGuidesStroke": "#6c738080", + "listFilterWidget.background": "#0f131a", + "listFilterWidget.outline": "#e6b450", + "listFilterWidget.noMatchesOutline": "#d95757", + "list.filterMatchBackground": "#5f4c7266", + "list.filterMatchBorder": "#6c598066", + "activityBar.background": "#0b0e14", + "activityBar.foreground": "#565b66cc", + "activityBar.inactiveForeground": "#565b6699", + "activityBar.border": "#0b0e14", + "activityBar.activeBorder": "#e6b450", + "activityBarBadge.background": "#e6b450", + "activityBarBadge.foreground": "#734d00", + "sideBar.background": "#0b0e14", + "sideBar.border": "#0b0e14", + "sideBarTitle.foreground": "#565b66", + "sideBarSectionHeader.background": "#0b0e14", + "sideBarSectionHeader.foreground": "#565b66", + "sideBarSectionHeader.border": "#0b0e14", + "minimap.background": "#0b0e14", + "minimap.selectionHighlight": "#409fff4d", + "minimap.errorHighlight": "#d95757", + "minimap.findMatchHighlight": "#6c5980", + "minimapGutter.addedBackground": "#7fd962", + "minimapGutter.modifiedBackground": "#73b8ff", + "minimapGutter.deletedBackground": "#f26d78", + "editorGroup.border": "#1e232b", + "editorGroup.background": "#0f131a", + "editorGroupHeader.noTabsBackground": "#0b0e14", + "editorGroupHeader.tabsBackground": "#0b0e14", + "editorGroupHeader.tabsBorder": "#0b0e14", + "tab.activeBackground": "#0b0e14", + "tab.activeForeground": "#bfbdb6", + "tab.border": "#0b0e14", + "tab.activeBorder": "#e6b450", + "tab.unfocusedActiveBorder": "#565b66", + "tab.inactiveBackground": "#0b0e14", + "tab.inactiveForeground": "#565b66", + "tab.unfocusedActiveForeground": "#565b66", + "tab.unfocusedInactiveForeground": "#565b66", + "editor.background": "#0b0e14", + "editor.foreground": "#bfbdb6", + "editorLineNumber.foreground": "#6c738099", + "editorLineNumber.activeForeground": "#6c7380e6", + "editorCursor.foreground": "#e6b450", + "editor.inactiveSelectionBackground": "#409fff21", + "editor.selectionBackground": "#409fff4d", + "editor.selectionHighlightBackground": "#7fd96226", + "editor.selectionHighlightBorder": "#7fd96200", + "editor.wordHighlightBackground": "#73b8ff14", + "editor.wordHighlightStrongBackground": "#7fd96214", + "editor.wordHighlightBorder": "#73b8ff80", + "editor.wordHighlightStrongBorder": "#7fd96280", + "editor.findMatchBackground": "#6c5980", + "editor.findMatchBorder": "#6c5980", + "editor.findMatchHighlightBackground": "#6c598066", + "editor.findMatchHighlightBorder": "#5f4c7266", + "editor.findRangeHighlightBackground": "#6c598040", + "editor.rangeHighlightBackground": "#6c598033", + "editor.lineHighlightBackground": "#131721", + "editorLink.activeForeground": "#e6b450", + "editorWhitespace.foreground": "#6c738099", + "editorIndentGuide.background": "#6c738033", + "editorIndentGuide.activeBackground": "#6c738080", + "editorRuler.foreground": "#6c738033", + "editorCodeLens.foreground": "#acb6bf8c", + "editorBracketMatch.background": "#6c73804d", + "editorBracketMatch.border": "#6c73804d", + "editor.snippetTabstopHighlightBackground": "#7fd96233", + "editorOverviewRuler.border": "#1e232b", + "editorOverviewRuler.modifiedForeground": "#73b8ff", + "editorOverviewRuler.addedForeground": "#7fd962", + "editorOverviewRuler.deletedForeground": "#f26d78", + "editorOverviewRuler.errorForeground": "#d95757", + "editorOverviewRuler.warningForeground": "#e6b450", + "editorOverviewRuler.bracketMatchForeground": "#6c7380b3", + "editorOverviewRuler.wordHighlightForeground": "#73b8ff66", + "editorOverviewRuler.wordHighlightStrongForeground": "#7fd96266", + "editorOverviewRuler.findMatchForeground": "#6c5980", + "editorError.foreground": "#d95757", + "editorWarning.foreground": "#e6b450", + "editorGutter.modifiedBackground": "#73b8ffcc", + "editorGutter.addedBackground": "#7fd962cc", + "editorGutter.deletedBackground": "#f26d78cc", + "diffEditor.insertedTextBackground": "#7fd9621f", + "diffEditor.removedTextBackground": "#f26d781f", + "diffEditor.diagonalFill": "#1e232b", + "editorWidget.background": "#0f131a", + "editorWidget.border": "#1e232b", + "editorHoverWidget.background": "#0f131a", + "editorHoverWidget.border": "#1e232b", + "editorSuggestWidget.background": "#0f131a", + "editorSuggestWidget.border": "#1e232b", + "editorSuggestWidget.highlightForeground": "#e6b450", + "editorSuggestWidget.selectedBackground": "#47526640", + "debugExceptionWidget.border": "#1e232b", + "debugExceptionWidget.background": "#0f131a", + "editorMarkerNavigation.background": "#0f131a", + "peekView.border": "#47526640", + "peekViewTitle.background": "#47526640", + "peekViewTitleDescription.foreground": "#565b66", + "peekViewTitleLabel.foreground": "#bfbdb6", + "peekViewEditor.background": "#0f131a", + "peekViewEditor.matchHighlightBackground": "#6c598066", + "peekViewEditor.matchHighlightBorder": "#5f4c7266", + "peekViewResult.background": "#0f131a", + "peekViewResult.fileForeground": "#bfbdb6", + "peekViewResult.lineForeground": "#565b66", + "peekViewResult.matchHighlightBackground": "#6c598066", + "peekViewResult.selectionBackground": "#47526640", + "panel.background": "#0b0e14", + "panel.border": "#1e232b", + "panelTitle.activeBorder": "#e6b450", + "panelTitle.activeForeground": "#bfbdb6", + "panelTitle.inactiveForeground": "#565b66", + "statusBar.background": "#0b0e14", + "statusBar.foreground": "#565b66", + "statusBar.border": "#0b0e14", + "statusBar.debuggingBackground": "#f29668", + "statusBar.debuggingForeground": "#0d1017", + "statusBar.noFolderBackground": "#0f131a", + "statusBarItem.activeBackground": "#565b6633", + "statusBarItem.hoverBackground": "#565b6633", + "statusBarItem.prominentBackground": "#1e232b", + "statusBarItem.prominentHoverBackground": "#00000030", + "statusBarItem.remoteBackground": "#e6b450", + "statusBarItem.remoteForeground": "#734d00", + "titleBar.activeBackground": "#0b0e14", + "titleBar.activeForeground": "#bfbdb6", + "titleBar.inactiveBackground": "#0b0e14", + "titleBar.inactiveForeground": "#565b66", + "titleBar.border": "#0b0e14", + "extensionButton.prominentForeground": "#734d00", + "extensionButton.prominentBackground": "#e6b450", + "extensionButton.prominentHoverBackground": "#e1af4b", + "pickerGroup.border": "#1e232b", + "pickerGroup.foreground": "#565b6680", + "debugToolBar.background": "#0f131a", + "debugIcon.breakpointForeground": "#f29668", + "debugIcon.breakpointDisabledForeground": "#f2966880", + "debugConsoleInputIcon.foreground": "#e6b450", + "welcomePage.tileBackground": "#0b0e14", + "welcomePage.tileShadow": "#00000080", + "welcomePage.progress.background": "#131721", + "welcomePage.buttonBackground": "#e6b45066", + "walkThrough.embeddedEditorBackground": "#0f131a", + "gitDecoration.modifiedResourceForeground": "#73b8ffb3", + "gitDecoration.deletedResourceForeground": "#f26d78b3", + "gitDecoration.untrackedResourceForeground": "#7fd962b3", + "gitDecoration.ignoredResourceForeground": "#565b6680", + "gitDecoration.conflictingResourceForeground": "", + "gitDecoration.submoduleResourceForeground": "#d2a6ffb3", + "settings.headerForeground": "#bfbdb6", + "settings.modifiedItemIndicator": "#73b8ff", + "keybindingLabel.background": "#565b661a", + "keybindingLabel.foreground": "#bfbdb6", + "keybindingLabel.border": "#bfbdb61a", + "keybindingLabel.bottomBorder": "#bfbdb61a", + "terminal.background": "#0b0e14", + "terminal.foreground": "#bfbdb6", + "terminal.ansiBlack": "#1e232b", + "terminal.ansiRed": "#ea6c73", + "terminal.ansiGreen": "#7fd962", + "terminal.ansiYellow": "#f9af4f", + "terminal.ansiBlue": "#53bdfa", + "terminal.ansiMagenta": "#cda1fa", + "terminal.ansiCyan": "#90e1c6", + "terminal.ansiWhite": "#c7c7c7", + "terminal.ansiBrightBlack": "#686868", + "terminal.ansiBrightRed": "#f07178", + "terminal.ansiBrightGreen": "#aad94c", + "terminal.ansiBrightYellow": "#ffb454", + "terminal.ansiBrightBlue": "#59c2ff", + "terminal.ansiBrightMagenta": "#d2a6ff", + "terminal.ansiBrightCyan": "#95e6cb", + "terminal.ansiBrightWhite": "#ffffff" + }, + "tokenColors": [ + { + "settings": { + "background": "#0b0e14", + "foreground": "#bfbdb6" + } + }, + { + "name": "Comment", + "scope": [ + "comment" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#acb6bf8c" + } + }, + { + "name": "String", + "scope": [ + "string", + "constant.other.symbol" + ], + "settings": { + "foreground": "#aad94c" + } + }, + { + "name": "Regular Expressions and Escape Characters", + "scope": [ + "string.regexp", + "constant.character", + "constant.other" + ], + "settings": { + "foreground": "#95e6cb" + } + }, + { + "name": "Number", + "scope": [ + "constant.numeric" + ], + "settings": { + "foreground": "#d2a6ff" + } + }, + { + "name": "Built-in constants", + "scope": [ + "constant.language" + ], + "settings": { + "foreground": "#d2a6ff" + } + }, + { + "name": "Variable", + "scope": [ + "variable", + "variable.parameter.function-call" + ], + "settings": { + "foreground": "#bfbdb6" + } + }, + { + "name": "Member Variable", + "scope": [ + "variable.member" + ], + "settings": { + "foreground": "#f07178" + } + }, + { + "name": "Language variable", + "scope": [ + "variable.language" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#39bae6" + } + }, + { + "name": "Storage", + "scope": [ + "storage" + ], + "settings": { + "foreground": "#ff8f40" + } + }, + { + "name": "Keyword", + "scope": [ + "keyword" + ], + "settings": { + "foreground": "#ff8f40" + } + }, + { + "name": "Operators", + "scope": [ + "keyword.operator" + ], + "settings": { + "foreground": "#f29668" + } + }, + { + "name": "Separators like ; or ,", + "scope": [ + "punctuation.separator", + "punctuation.terminator" + ], + "settings": { + "foreground": "#bfbdb6b3" + } + }, + { + "name": "Punctuation", + "scope": [ + "punctuation.section" + ], + "settings": { + "foreground": "#bfbdb6" + } + }, + { + "name": "Accessor", + "scope": [ + "punctuation.accessor" + ], + "settings": { + "foreground": "#f29668" + } + }, + { + "name": "JavaScript/TypeScript interpolation punctuation", + "scope": [ + "punctuation.definition.template-expression" + ], + "settings": { + "foreground": "#ff8f40" + } + }, + { + "name": "Ruby interpolation punctuation", + "scope": [ + "punctuation.section.embedded" + ], + "settings": { + "foreground": "#ff8f40" + } + }, + { + "name": "Interpolation text", + "scope": [ + "meta.embedded" + ], + "settings": { + "foreground": "#bfbdb6" + } + }, + { + "name": "Types fixes", + "scope": [ + "source.java storage.type", + "source.haskell storage.type", + "source.c storage.type" + ], + "settings": { + "foreground": "#59c2ff" + } + }, + { + "name": "Inherited class type", + "scope": [ + "entity.other.inherited-class" + ], + "settings": { + "foreground": "#39bae6" + } + }, + { + "name": "Lambda arrow", + "scope": [ + "storage.type.function" + ], + "settings": { + "foreground": "#ff8f40" + } + }, + { + "name": "Java primitive variable types", + "scope": [ + "source.java storage.type.primitive" + ], + "settings": { + "foreground": "#39bae6" + } + }, + { + "name": "Function name", + "scope": [ + "entity.name.function" + ], + "settings": { + "foreground": "#ffb454" + } + }, + { + "name": "Function arguments", + "scope": [ + "variable.parameter", + "meta.parameter" + ], + "settings": { + "foreground": "#d2a6ff" + } + }, + { + "name": "Function call", + "scope": [ + "variable.function", + "variable.annotation", + "meta.function-call.generic", + "support.function.go" + ], + "settings": { + "foreground": "#ffb454" + } + }, + { + "name": "Library function", + "scope": [ + "support.function", + "support.macro" + ], + "settings": { + "foreground": "#f07178" + } + }, + { + "name": "Imports and packages", + "scope": [ + "entity.name.import", + "entity.name.package" + ], + "settings": { + "foreground": "#aad94c" + } + }, + { + "name": "Entity name", + "scope": [ + "entity.name" + ], + "settings": { + "foreground": "#59c2ff" + } + }, + { + "name": "Tag", + "scope": [ + "entity.name.tag", + "meta.tag.sgml" + ], + "settings": { + "foreground": "#39bae6" + } + }, + { + "name": "JSX Component", + "scope": [ + "support.class.component" + ], + "settings": { + "foreground": "#59c2ff" + } + }, + { + "name": "Tag start/end", + "scope": [ + "punctuation.definition.tag.end", + "punctuation.definition.tag.begin", + "punctuation.definition.tag" + ], + "settings": { + "foreground": "#39bae680" + } + }, + { + "name": "Tag attribute", + "scope": [ + "entity.other.attribute-name" + ], + "settings": { + "foreground": "#ffb454" + } + }, + { + "name": "Library constant", + "scope": [ + "support.constant" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#f29668" + } + }, + { + "name": "Library class/type", + "scope": [ + "support.type", + "support.class", + "source.go storage.type" + ], + "settings": { + "foreground": "#39bae6" + } + }, + { + "name": "Decorators/annotation", + "scope": [ + "meta.decorator variable.other", + "meta.decorator punctuation.decorator", + "storage.type.annotation" + ], + "settings": { + "foreground": "#e6b673" + } + }, + { + "name": "Invalid", + "scope": [ + "invalid" + ], + "settings": { + "foreground": "#d95757" + } + }, + { + "name": "diff.header", + "scope": [ + "meta.diff", + "meta.diff.header" + ], + "settings": { + "foreground": "#c594c5" + } + }, + { + "name": "Ruby class methods", + "scope": [ + "source.ruby variable.other.readwrite" + ], + "settings": { + "foreground": "#ffb454" + } + }, + { + "name": "CSS tag names", + "scope": [ + "source.css entity.name.tag", + "source.sass entity.name.tag", + "source.scss entity.name.tag", + "source.less entity.name.tag", + "source.stylus entity.name.tag" + ], + "settings": { + "foreground": "#59c2ff" + } + }, + { + "name": "CSS browser prefix", + "scope": [ + "source.css support.type", + "source.sass support.type", + "source.scss support.type", + "source.less support.type", + "source.stylus support.type" + ], + "settings": { + "foreground": "#acb6bf8c" + } + }, + { + "name": "CSS Properties", + "scope": [ + "support.type.property-name" + ], + "settings": { + "fontStyle": "normal", + "foreground": "#39bae6" + } + }, + { + "name": "Search Results Numbers", + "scope": [ + "constant.numeric.line-number.find-in-files - match" + ], + "settings": { + "foreground": "#acb6bf8c" + } + }, + { + "name": "Search Results Match Numbers", + "scope": [ + "constant.numeric.line-number.match" + ], + "settings": { + "foreground": "#ff8f40" + } + }, + { + "name": "Search Results Lines", + "scope": [ + "entity.name.filename.find-in-files" + ], + "settings": { + "foreground": "#aad94c" + } + }, + { + "scope": [ + "message.error" + ], + "settings": { + "foreground": "#d95757" + } + }, + { + "name": "Markup heading", + "scope": [ + "markup.heading", + "markup.heading entity.name" + ], + "settings": { + "fontStyle": "bold", + "foreground": "#aad94c" + } + }, + { + "name": "Markup links", + "scope": [ + "markup.underline.link", + "string.other.link" + ], + "settings": { + "foreground": "#39bae6" + } + }, + { + "name": "Markup Italic", + "scope": [ + "markup.italic" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#f07178" + } + }, + { + "name": "Markup Bold", + "scope": [ + "markup.bold" + ], + "settings": { + "fontStyle": "bold", + "foreground": "#f07178" + } + }, + { + "name": "Markup Bold/italic", + "scope": [ + "markup.italic markup.bold", + "markup.bold markup.italic" + ], + "settings": { + "fontStyle": "bold italic" + } + }, + { + "name": "Markup Code", + "scope": [ + "markup.raw" + ], + "settings": { + "background": "#bfbdb605" + } + }, + { + "name": "Markup Code Inline", + "scope": [ + "markup.raw.inline" + ], + "settings": { + "background": "#bfbdb60f" + } + }, + { + "name": "Markdown Separator", + "scope": [ + "meta.separator" + ], + "settings": { + "fontStyle": "bold", + "background": "#bfbdb60f", + "foreground": "#acb6bf8c" + } + }, + { + "name": "Markup Blockquote", + "scope": [ + "markup.quote" + ], + "settings": { + "foreground": "#95e6cb", + "fontStyle": "italic" + } + }, + { + "name": "Markup List Bullet", + "scope": [ + "markup.list punctuation.definition.list.begin" + ], + "settings": { + "foreground": "#ffb454" + } + }, + { + "name": "Markup added", + "scope": [ + "markup.inserted" + ], + "settings": { + "foreground": "#7fd962" + } + }, + { + "name": "Markup modified", + "scope": [ + "markup.changed" + ], + "settings": { + "foreground": "#73b8ff" + } + }, + { + "name": "Markup removed", + "scope": [ + "markup.deleted" + ], + "settings": { + "foreground": "#f26d78" + } + }, + { + "name": "Markup Strike", + "scope": [ + "markup.strike" + ], + "settings": { + "foreground": "#e6b673" + } + }, + { + "name": "Markup Table", + "scope": [ + "markup.table" + ], + "settings": { + "background": "#bfbdb60f", + "foreground": "#39bae6" + } + }, + { + "name": "Markup Raw Inline", + "scope": [ + "text.html.markdown markup.inline.raw" + ], + "settings": { + "foreground": "#f29668" + } + }, + { + "name": "Markdown - Line Break", + "scope": [ + "text.html.markdown meta.dummy.line-break" + ], + "settings": { + "background": "#acb6bf8c", + "foreground": "#acb6bf8c" + } + }, + { + "name": "Markdown - Raw Block Fenced", + "scope": [ + "punctuation.definition.markdown" + ], + "settings": { + "background": "#bfbdb6", + "foreground": "#acb6bf8c" + } + } + ], + "semanticHighlighting": true, + "semanticTokenColors": { + "parameter.label": "#bfbdb6" + } +} \ No newline at end of file diff --git a/assets/themes/src/vsc/ayu/ayu-light.json b/assets/themes/src/vsc/ayu/ayu-light.json new file mode 100644 index 0000000000..782b04ac76 --- /dev/null +++ b/assets/themes/src/vsc/ayu/ayu-light.json @@ -0,0 +1,847 @@ +{ + "type": "light", + "colors": { + "focusBorder": "#ffaa33b3", + "foreground": "#8a9199", + "widget.shadow": "#00000026", + "selection.background": "#035bd626", + "icon.foreground": "#8a9199", + "errorForeground": "#e65050", + "descriptionForeground": "#8a9199", + "textBlockQuote.background": "#f3f4f5", + "textLink.foreground": "#ffaa33", + "textLink.activeForeground": "#ffaa33", + "textPreformat.foreground": "#5c6166", + "button.background": "#ffaa33", + "button.foreground": "#804a00", + "button.hoverBackground": "#f9a52e", + "button.secondaryBackground": "#8a919933", + "button.secondaryForeground": "#5c6166", + "button.secondaryHoverBackground": "#8a919980", + "dropdown.background": "#fcfcfc", + "dropdown.foreground": "#8a9199", + "dropdown.border": "#8a919945", + "input.background": "#fcfcfc", + "input.border": "#8a919945", + "input.foreground": "#5c6166", + "input.placeholderForeground": "#8a919980", + "inputOption.activeBorder": "#f4a0284d", + "inputOption.activeBackground": "#ffaa3333", + "inputOption.activeForeground": "#f4a028", + "inputValidation.errorBackground": "#fcfcfc", + "inputValidation.errorBorder": "#e65050", + "inputValidation.infoBackground": "#f8f9fa", + "inputValidation.infoBorder": "#55b4d4", + "inputValidation.warningBackground": "#f8f9fa", + "inputValidation.warningBorder": "#f2ae49", + "scrollbar.shadow": "#6b7d8f00", + "scrollbarSlider.background": "#8a919966", + "scrollbarSlider.hoverBackground": "#8a919999", + "scrollbarSlider.activeBackground": "#8a9199b3", + "badge.background": "#ffaa3333", + "badge.foreground": "#f4a028", + "progressBar.background": "#ffaa33", + "list.activeSelectionBackground": "#56728f1f", + "list.activeSelectionForeground": "#5c6166", + "list.focusBackground": "#56728f1f", + "list.focusForeground": "#5c6166", + "list.focusOutline": "#56728f1f", + "list.highlightForeground": "#ffaa33", + "list.deemphasizedForeground": "#e65050", + "list.hoverBackground": "#56728f1f", + "list.inactiveSelectionBackground": "#6b7d8f1f", + "list.inactiveSelectionForeground": "#8a9199", + "list.invalidItemForeground": "#8a91994d", + "list.errorForeground": "#e65050", + "tree.indentGuidesStroke": "#8a919959", + "listFilterWidget.background": "#f3f4f5", + "listFilterWidget.outline": "#ffaa33", + "listFilterWidget.noMatchesOutline": "#e65050", + "list.filterMatchBackground": "#ddcaef73", + "list.filterMatchBorder": "#ecd9ff73", + "activityBar.background": "#f8f9fa", + "activityBar.foreground": "#8a9199cc", + "activityBar.inactiveForeground": "#8a919999", + "activityBar.border": "#f8f9fa", + "activityBar.activeBorder": "#ffaa33", + "activityBarBadge.background": "#ffaa33", + "activityBarBadge.foreground": "#f8f9fa", + "sideBar.background": "#f8f9fa", + "sideBar.border": "#f8f9fa", + "sideBarTitle.foreground": "#8a9199", + "sideBarSectionHeader.background": "#f8f9fa", + "sideBarSectionHeader.foreground": "#8a9199", + "sideBarSectionHeader.border": "#f8f9fa", + "minimap.background": "#f8f9fa", + "minimap.selectionHighlight": "#035bd626", + "minimap.errorHighlight": "#e65050", + "minimap.findMatchHighlight": "#ecd9ff", + "minimapGutter.addedBackground": "#6cbf43", + "minimapGutter.modifiedBackground": "#478acc", + "minimapGutter.deletedBackground": "#ff7383", + "editorGroup.border": "#6b7d8f1f", + "editorGroup.background": "#f3f4f5", + "editorGroupHeader.noTabsBackground": "#f8f9fa", + "editorGroupHeader.tabsBackground": "#f8f9fa", + "editorGroupHeader.tabsBorder": "#f8f9fa", + "tab.activeBackground": "#f8f9fa", + "tab.activeForeground": "#5c6166", + "tab.border": "#f8f9fa", + "tab.activeBorder": "#ffaa33", + "tab.unfocusedActiveBorder": "#8a9199", + "tab.inactiveBackground": "#f8f9fa", + "tab.inactiveForeground": "#8a9199", + "tab.unfocusedActiveForeground": "#8a9199", + "tab.unfocusedInactiveForeground": "#8a9199", + "editor.background": "#f8f9fa", + "editor.foreground": "#5c6166", + "editorLineNumber.foreground": "#8a919966", + "editorLineNumber.activeForeground": "#8a9199cc", + "editorCursor.foreground": "#ffaa33", + "editor.inactiveSelectionBackground": "#035bd612", + "editor.selectionBackground": "#035bd626", + "editor.selectionHighlightBackground": "#6cbf4326", + "editor.selectionHighlightBorder": "#6cbf4300", + "editor.wordHighlightBackground": "#478acc14", + "editor.wordHighlightStrongBackground": "#6cbf4314", + "editor.wordHighlightBorder": "#478acc80", + "editor.wordHighlightStrongBorder": "#6cbf4380", + "editor.findMatchBackground": "#ecd9ff", + "editor.findMatchBorder": "#ecd9ff", + "editor.findMatchHighlightBackground": "#ecd9ff73", + "editor.findMatchHighlightBorder": "#ddcaef73", + "editor.findRangeHighlightBackground": "#ecd9ff40", + "editor.rangeHighlightBackground": "#ecd9ff33", + "editor.lineHighlightBackground": "#8a91991a", + "editorLink.activeForeground": "#ffaa33", + "editorWhitespace.foreground": "#8a919966", + "editorIndentGuide.background": "#8a91992e", + "editorIndentGuide.activeBackground": "#8a919959", + "editorRuler.foreground": "#8a91992e", + "editorCodeLens.foreground": "#787b8099", + "editorBracketMatch.background": "#8a91994d", + "editorBracketMatch.border": "#8a91994d", + "editor.snippetTabstopHighlightBackground": "#6cbf4333", + "editorOverviewRuler.border": "#6b7d8f1f", + "editorOverviewRuler.modifiedForeground": "#478acc", + "editorOverviewRuler.addedForeground": "#6cbf43", + "editorOverviewRuler.deletedForeground": "#ff7383", + "editorOverviewRuler.errorForeground": "#e65050", + "editorOverviewRuler.warningForeground": "#ffaa33", + "editorOverviewRuler.bracketMatchForeground": "#8a9199b3", + "editorOverviewRuler.wordHighlightForeground": "#478acc66", + "editorOverviewRuler.wordHighlightStrongForeground": "#6cbf4366", + "editorOverviewRuler.findMatchForeground": "#ecd9ff", + "editorError.foreground": "#e65050", + "editorWarning.foreground": "#ffaa33", + "editorGutter.modifiedBackground": "#478acccc", + "editorGutter.addedBackground": "#6cbf43cc", + "editorGutter.deletedBackground": "#ff7383cc", + "diffEditor.insertedTextBackground": "#6cbf431f", + "diffEditor.removedTextBackground": "#ff73831f", + "diffEditor.diagonalFill": "#6b7d8f1f", + "editorWidget.background": "#f3f4f5", + "editorWidget.border": "#6b7d8f1f", + "editorHoverWidget.background": "#f3f4f5", + "editorHoverWidget.border": "#6b7d8f1f", + "editorSuggestWidget.background": "#f3f4f5", + "editorSuggestWidget.border": "#6b7d8f1f", + "editorSuggestWidget.highlightForeground": "#ffaa33", + "editorSuggestWidget.selectedBackground": "#56728f1f", + "debugExceptionWidget.border": "#6b7d8f1f", + "debugExceptionWidget.background": "#f3f4f5", + "editorMarkerNavigation.background": "#f3f4f5", + "peekView.border": "#56728f1f", + "peekViewTitle.background": "#56728f1f", + "peekViewTitleDescription.foreground": "#8a9199", + "peekViewTitleLabel.foreground": "#5c6166", + "peekViewEditor.background": "#f3f4f5", + "peekViewEditor.matchHighlightBackground": "#ecd9ff73", + "peekViewEditor.matchHighlightBorder": "#ddcaef73", + "peekViewResult.background": "#f3f4f5", + "peekViewResult.fileForeground": "#5c6166", + "peekViewResult.lineForeground": "#8a9199", + "peekViewResult.matchHighlightBackground": "#ecd9ff73", + "peekViewResult.selectionBackground": "#56728f1f", + "panel.background": "#f8f9fa", + "panel.border": "#6b7d8f1f", + "panelTitle.activeBorder": "#ffaa33", + "panelTitle.activeForeground": "#5c6166", + "panelTitle.inactiveForeground": "#8a9199", + "statusBar.background": "#f8f9fa", + "statusBar.foreground": "#8a9199", + "statusBar.border": "#f8f9fa", + "statusBar.debuggingBackground": "#ed9366", + "statusBar.debuggingForeground": "#fcfcfc", + "statusBar.noFolderBackground": "#f3f4f5", + "statusBarItem.activeBackground": "#8a919933", + "statusBarItem.hoverBackground": "#8a919933", + "statusBarItem.prominentBackground": "#6b7d8f1f", + "statusBarItem.prominentHoverBackground": "#00000030", + "statusBarItem.remoteBackground": "#ffaa33", + "statusBarItem.remoteForeground": "#804a00", + "titleBar.activeBackground": "#f8f9fa", + "titleBar.activeForeground": "#5c6166", + "titleBar.inactiveBackground": "#f8f9fa", + "titleBar.inactiveForeground": "#8a9199", + "titleBar.border": "#f8f9fa", + "extensionButton.prominentForeground": "#804a00", + "extensionButton.prominentBackground": "#ffaa33", + "extensionButton.prominentHoverBackground": "#f9a52e", + "pickerGroup.border": "#6b7d8f1f", + "pickerGroup.foreground": "#8a919980", + "debugToolBar.background": "#f3f4f5", + "debugIcon.breakpointForeground": "#ed9366", + "debugIcon.breakpointDisabledForeground": "#ed936680", + "debugConsoleInputIcon.foreground": "#ffaa33", + "welcomePage.tileBackground": "#f8f9fa", + "welcomePage.tileShadow": "#00000026", + "welcomePage.progress.background": "#8a91991a", + "welcomePage.buttonBackground": "#ffaa3366", + "walkThrough.embeddedEditorBackground": "#f3f4f5", + "gitDecoration.modifiedResourceForeground": "#478accb3", + "gitDecoration.deletedResourceForeground": "#ff7383b3", + "gitDecoration.untrackedResourceForeground": "#6cbf43b3", + "gitDecoration.ignoredResourceForeground": "#8a919980", + "gitDecoration.conflictingResourceForeground": "", + "gitDecoration.submoduleResourceForeground": "#a37accb3", + "settings.headerForeground": "#5c6166", + "settings.modifiedItemIndicator": "#478acc", + "keybindingLabel.background": "#8a91991a", + "keybindingLabel.foreground": "#5c6166", + "keybindingLabel.border": "#5c61661a", + "keybindingLabel.bottomBorder": "#5c61661a", + "terminal.background": "#f8f9fa", + "terminal.foreground": "#5c6166", + "terminal.ansiBlack": "#000000", + "terminal.ansiRed": "#ea6c6d", + "terminal.ansiGreen": "#6cbf43", + "terminal.ansiYellow": "#eca944", + "terminal.ansiBlue": "#3199e1", + "terminal.ansiMagenta": "#9e75c7", + "terminal.ansiCyan": "#46ba94", + "terminal.ansiWhite": "#c7c7c7", + "terminal.ansiBrightBlack": "#686868", + "terminal.ansiBrightRed": "#f07171", + "terminal.ansiBrightGreen": "#86b300", + "terminal.ansiBrightYellow": "#f2ae49", + "terminal.ansiBrightBlue": "#399ee6", + "terminal.ansiBrightMagenta": "#a37acc", + "terminal.ansiBrightCyan": "#4cbf99", + "terminal.ansiBrightWhite": "#d1d1d1" + }, + "tokenColors": [ + { + "settings": { + "background": "#f8f9fa", + "foreground": "#5c6166" + } + }, + { + "name": "Comment", + "scope": [ + "comment" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#787b8099" + } + }, + { + "name": "String", + "scope": [ + "string", + "constant.other.symbol" + ], + "settings": { + "foreground": "#86b300" + } + }, + { + "name": "Regular Expressions and Escape Characters", + "scope": [ + "string.regexp", + "constant.character", + "constant.other" + ], + "settings": { + "foreground": "#4cbf99" + } + }, + { + "name": "Number", + "scope": [ + "constant.numeric" + ], + "settings": { + "foreground": "#a37acc" + } + }, + { + "name": "Built-in constants", + "scope": [ + "constant.language" + ], + "settings": { + "foreground": "#a37acc" + } + }, + { + "name": "Variable", + "scope": [ + "variable", + "variable.parameter.function-call" + ], + "settings": { + "foreground": "#5c6166" + } + }, + { + "name": "Member Variable", + "scope": [ + "variable.member" + ], + "settings": { + "foreground": "#f07171" + } + }, + { + "name": "Language variable", + "scope": [ + "variable.language" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#55b4d4" + } + }, + { + "name": "Storage", + "scope": [ + "storage" + ], + "settings": { + "foreground": "#fa8d3e" + } + }, + { + "name": "Keyword", + "scope": [ + "keyword" + ], + "settings": { + "foreground": "#fa8d3e" + } + }, + { + "name": "Operators", + "scope": [ + "keyword.operator" + ], + "settings": { + "foreground": "#ed9366" + } + }, + { + "name": "Separators like ; or ,", + "scope": [ + "punctuation.separator", + "punctuation.terminator" + ], + "settings": { + "foreground": "#5c6166b3" + } + }, + { + "name": "Punctuation", + "scope": [ + "punctuation.section" + ], + "settings": { + "foreground": "#5c6166" + } + }, + { + "name": "Accessor", + "scope": [ + "punctuation.accessor" + ], + "settings": { + "foreground": "#ed9366" + } + }, + { + "name": "JavaScript/TypeScript interpolation punctuation", + "scope": [ + "punctuation.definition.template-expression" + ], + "settings": { + "foreground": "#fa8d3e" + } + }, + { + "name": "Ruby interpolation punctuation", + "scope": [ + "punctuation.section.embedded" + ], + "settings": { + "foreground": "#fa8d3e" + } + }, + { + "name": "Interpolation text", + "scope": [ + "meta.embedded" + ], + "settings": { + "foreground": "#5c6166" + } + }, + { + "name": "Types fixes", + "scope": [ + "source.java storage.type", + "source.haskell storage.type", + "source.c storage.type" + ], + "settings": { + "foreground": "#399ee6" + } + }, + { + "name": "Inherited class type", + "scope": [ + "entity.other.inherited-class" + ], + "settings": { + "foreground": "#55b4d4" + } + }, + { + "name": "Lambda arrow", + "scope": [ + "storage.type.function" + ], + "settings": { + "foreground": "#fa8d3e" + } + }, + { + "name": "Java primitive variable types", + "scope": [ + "source.java storage.type.primitive" + ], + "settings": { + "foreground": "#55b4d4" + } + }, + { + "name": "Function name", + "scope": [ + "entity.name.function" + ], + "settings": { + "foreground": "#f2ae49" + } + }, + { + "name": "Function arguments", + "scope": [ + "variable.parameter", + "meta.parameter" + ], + "settings": { + "foreground": "#a37acc" + } + }, + { + "name": "Function call", + "scope": [ + "variable.function", + "variable.annotation", + "meta.function-call.generic", + "support.function.go" + ], + "settings": { + "foreground": "#f2ae49" + } + }, + { + "name": "Library function", + "scope": [ + "support.function", + "support.macro" + ], + "settings": { + "foreground": "#f07171" + } + }, + { + "name": "Imports and packages", + "scope": [ + "entity.name.import", + "entity.name.package" + ], + "settings": { + "foreground": "#86b300" + } + }, + { + "name": "Entity name", + "scope": [ + "entity.name" + ], + "settings": { + "foreground": "#399ee6" + } + }, + { + "name": "Tag", + "scope": [ + "entity.name.tag", + "meta.tag.sgml" + ], + "settings": { + "foreground": "#55b4d4" + } + }, + { + "name": "JSX Component", + "scope": [ + "support.class.component" + ], + "settings": { + "foreground": "#399ee6" + } + }, + { + "name": "Tag start/end", + "scope": [ + "punctuation.definition.tag.end", + "punctuation.definition.tag.begin", + "punctuation.definition.tag" + ], + "settings": { + "foreground": "#55b4d480" + } + }, + { + "name": "Tag attribute", + "scope": [ + "entity.other.attribute-name" + ], + "settings": { + "foreground": "#f2ae49" + } + }, + { + "name": "Library constant", + "scope": [ + "support.constant" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#ed9366" + } + }, + { + "name": "Library class/type", + "scope": [ + "support.type", + "support.class", + "source.go storage.type" + ], + "settings": { + "foreground": "#55b4d4" + } + }, + { + "name": "Decorators/annotation", + "scope": [ + "meta.decorator variable.other", + "meta.decorator punctuation.decorator", + "storage.type.annotation" + ], + "settings": { + "foreground": "#e6ba7e" + } + }, + { + "name": "Invalid", + "scope": [ + "invalid" + ], + "settings": { + "foreground": "#e65050" + } + }, + { + "name": "diff.header", + "scope": [ + "meta.diff", + "meta.diff.header" + ], + "settings": { + "foreground": "#c594c5" + } + }, + { + "name": "Ruby class methods", + "scope": [ + "source.ruby variable.other.readwrite" + ], + "settings": { + "foreground": "#f2ae49" + } + }, + { + "name": "CSS tag names", + "scope": [ + "source.css entity.name.tag", + "source.sass entity.name.tag", + "source.scss entity.name.tag", + "source.less entity.name.tag", + "source.stylus entity.name.tag" + ], + "settings": { + "foreground": "#399ee6" + } + }, + { + "name": "CSS browser prefix", + "scope": [ + "source.css support.type", + "source.sass support.type", + "source.scss support.type", + "source.less support.type", + "source.stylus support.type" + ], + "settings": { + "foreground": "#787b8099" + } + }, + { + "name": "CSS Properties", + "scope": [ + "support.type.property-name" + ], + "settings": { + "fontStyle": "normal", + "foreground": "#55b4d4" + } + }, + { + "name": "Search Results Numbers", + "scope": [ + "constant.numeric.line-number.find-in-files - match" + ], + "settings": { + "foreground": "#787b8099" + } + }, + { + "name": "Search Results Match Numbers", + "scope": [ + "constant.numeric.line-number.match" + ], + "settings": { + "foreground": "#fa8d3e" + } + }, + { + "name": "Search Results Lines", + "scope": [ + "entity.name.filename.find-in-files" + ], + "settings": { + "foreground": "#86b300" + } + }, + { + "scope": [ + "message.error" + ], + "settings": { + "foreground": "#e65050" + } + }, + { + "name": "Markup heading", + "scope": [ + "markup.heading", + "markup.heading entity.name" + ], + "settings": { + "fontStyle": "bold", + "foreground": "#86b300" + } + }, + { + "name": "Markup links", + "scope": [ + "markup.underline.link", + "string.other.link" + ], + "settings": { + "foreground": "#55b4d4" + } + }, + { + "name": "Markup Italic", + "scope": [ + "markup.italic" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#f07171" + } + }, + { + "name": "Markup Bold", + "scope": [ + "markup.bold" + ], + "settings": { + "fontStyle": "bold", + "foreground": "#f07171" + } + }, + { + "name": "Markup Bold/italic", + "scope": [ + "markup.italic markup.bold", + "markup.bold markup.italic" + ], + "settings": { + "fontStyle": "bold italic" + } + }, + { + "name": "Markup Code", + "scope": [ + "markup.raw" + ], + "settings": { + "background": "#5c616605" + } + }, + { + "name": "Markup Code Inline", + "scope": [ + "markup.raw.inline" + ], + "settings": { + "background": "#5c61660f" + } + }, + { + "name": "Markdown Separator", + "scope": [ + "meta.separator" + ], + "settings": { + "fontStyle": "bold", + "background": "#5c61660f", + "foreground": "#787b8099" + } + }, + { + "name": "Markup Blockquote", + "scope": [ + "markup.quote" + ], + "settings": { + "foreground": "#4cbf99", + "fontStyle": "italic" + } + }, + { + "name": "Markup List Bullet", + "scope": [ + "markup.list punctuation.definition.list.begin" + ], + "settings": { + "foreground": "#f2ae49" + } + }, + { + "name": "Markup added", + "scope": [ + "markup.inserted" + ], + "settings": { + "foreground": "#6cbf43" + } + }, + { + "name": "Markup modified", + "scope": [ + "markup.changed" + ], + "settings": { + "foreground": "#478acc" + } + }, + { + "name": "Markup removed", + "scope": [ + "markup.deleted" + ], + "settings": { + "foreground": "#ff7383" + } + }, + { + "name": "Markup Strike", + "scope": [ + "markup.strike" + ], + "settings": { + "foreground": "#e6ba7e" + } + }, + { + "name": "Markup Table", + "scope": [ + "markup.table" + ], + "settings": { + "background": "#5c61660f", + "foreground": "#55b4d4" + } + }, + { + "name": "Markup Raw Inline", + "scope": [ + "text.html.markdown markup.inline.raw" + ], + "settings": { + "foreground": "#ed9366" + } + }, + { + "name": "Markdown - Line Break", + "scope": [ + "text.html.markdown meta.dummy.line-break" + ], + "settings": { + "background": "#787b8099", + "foreground": "#787b8099" + } + }, + { + "name": "Markdown - Raw Block Fenced", + "scope": [ + "punctuation.definition.markdown" + ], + "settings": { + "background": "#5c6166", + "foreground": "#787b8099" + } + } + ], + "semanticHighlighting": true, + "semanticTokenColors": { + "parameter.label": "#5c6166" + } +} \ No newline at end of file diff --git a/assets/themes/src/vsc/ayu/ayu-mirage.json b/assets/themes/src/vsc/ayu/ayu-mirage.json new file mode 100644 index 0000000000..7708236829 --- /dev/null +++ b/assets/themes/src/vsc/ayu/ayu-mirage.json @@ -0,0 +1,847 @@ +{ + "type": "dark", + "colors": { + "focusBorder": "#ffcc66b3", + "foreground": "#707a8c", + "widget.shadow": "#12151cb3", + "selection.background": "#409fff40", + "icon.foreground": "#707a8c", + "errorForeground": "#ff6666", + "descriptionForeground": "#707a8c", + "textBlockQuote.background": "#1c212b", + "textLink.foreground": "#ffcc66", + "textLink.activeForeground": "#ffcc66", + "textPreformat.foreground": "#cccac2", + "button.background": "#ffcc66", + "button.foreground": "#805500", + "button.hoverBackground": "#fac761", + "button.secondaryBackground": "#707a8c33", + "button.secondaryForeground": "#cccac2", + "button.secondaryHoverBackground": "#707a8c80", + "dropdown.background": "#242936", + "dropdown.foreground": "#707a8c", + "dropdown.border": "#707a8c45", + "input.background": "#242936", + "input.border": "#707a8c45", + "input.foreground": "#cccac2", + "input.placeholderForeground": "#707a8c80", + "inputOption.activeBorder": "#ffcc664d", + "inputOption.activeBackground": "#ffcc6633", + "inputOption.activeForeground": "#ffcc66", + "inputValidation.errorBackground": "#242936", + "inputValidation.errorBorder": "#ff6666", + "inputValidation.infoBackground": "#1f2430", + "inputValidation.infoBorder": "#5ccfe6", + "inputValidation.warningBackground": "#1f2430", + "inputValidation.warningBorder": "#ffd173", + "scrollbar.shadow": "#171b2400", + "scrollbarSlider.background": "#707a8c66", + "scrollbarSlider.hoverBackground": "#707a8c99", + "scrollbarSlider.activeBackground": "#707a8cb3", + "badge.background": "#ffcc6633", + "badge.foreground": "#ffcc66", + "progressBar.background": "#ffcc66", + "list.activeSelectionBackground": "#63759926", + "list.activeSelectionForeground": "#cccac2", + "list.focusBackground": "#63759926", + "list.focusForeground": "#cccac2", + "list.focusOutline": "#63759926", + "list.highlightForeground": "#ffcc66", + "list.deemphasizedForeground": "#ff6666", + "list.hoverBackground": "#63759926", + "list.inactiveSelectionBackground": "#69758c1f", + "list.inactiveSelectionForeground": "#707a8c", + "list.invalidItemForeground": "#707a8c4d", + "list.errorForeground": "#ff6666", + "tree.indentGuidesStroke": "#8a919959", + "listFilterWidget.background": "#1c212b", + "listFilterWidget.outline": "#ffcc66", + "listFilterWidget.noMatchesOutline": "#ff6666", + "list.filterMatchBackground": "#5c467266", + "list.filterMatchBorder": "#69538066", + "activityBar.background": "#1f2430", + "activityBar.foreground": "#707a8ccc", + "activityBar.inactiveForeground": "#707a8c99", + "activityBar.border": "#1f2430", + "activityBar.activeBorder": "#ffcc66", + "activityBarBadge.background": "#ffcc66", + "activityBarBadge.foreground": "#805500", + "sideBar.background": "#1f2430", + "sideBar.border": "#1f2430", + "sideBarTitle.foreground": "#707a8c", + "sideBarSectionHeader.background": "#1f2430", + "sideBarSectionHeader.foreground": "#707a8c", + "sideBarSectionHeader.border": "#1f2430", + "minimap.background": "#1f2430", + "minimap.selectionHighlight": "#409fff40", + "minimap.errorHighlight": "#ff6666", + "minimap.findMatchHighlight": "#695380", + "minimapGutter.addedBackground": "#87d96c", + "minimapGutter.modifiedBackground": "#80bfff", + "minimapGutter.deletedBackground": "#f27983", + "editorGroup.border": "#171b24", + "editorGroup.background": "#1c212b", + "editorGroupHeader.noTabsBackground": "#1f2430", + "editorGroupHeader.tabsBackground": "#1f2430", + "editorGroupHeader.tabsBorder": "#1f2430", + "tab.activeBackground": "#1f2430", + "tab.activeForeground": "#cccac2", + "tab.border": "#1f2430", + "tab.activeBorder": "#ffcc66", + "tab.unfocusedActiveBorder": "#707a8c", + "tab.inactiveBackground": "#1f2430", + "tab.inactiveForeground": "#707a8c", + "tab.unfocusedActiveForeground": "#707a8c", + "tab.unfocusedInactiveForeground": "#707a8c", + "editor.background": "#1f2430", + "editor.foreground": "#cccac2", + "editorLineNumber.foreground": "#8a919966", + "editorLineNumber.activeForeground": "#8a9199cc", + "editorCursor.foreground": "#ffcc66", + "editor.inactiveSelectionBackground": "#409fff21", + "editor.selectionBackground": "#409fff40", + "editor.selectionHighlightBackground": "#87d96c26", + "editor.selectionHighlightBorder": "#87d96c00", + "editor.wordHighlightBackground": "#80bfff14", + "editor.wordHighlightStrongBackground": "#87d96c14", + "editor.wordHighlightBorder": "#80bfff80", + "editor.wordHighlightStrongBorder": "#87d96c80", + "editor.findMatchBackground": "#695380", + "editor.findMatchBorder": "#695380", + "editor.findMatchHighlightBackground": "#69538066", + "editor.findMatchHighlightBorder": "#5c467266", + "editor.findRangeHighlightBackground": "#69538040", + "editor.rangeHighlightBackground": "#69538033", + "editor.lineHighlightBackground": "#1a1f29", + "editorLink.activeForeground": "#ffcc66", + "editorWhitespace.foreground": "#8a919966", + "editorIndentGuide.background": "#8a91992e", + "editorIndentGuide.activeBackground": "#8a919959", + "editorRuler.foreground": "#8a91992e", + "editorCodeLens.foreground": "#b8cfe680", + "editorBracketMatch.background": "#8a91994d", + "editorBracketMatch.border": "#8a91994d", + "editor.snippetTabstopHighlightBackground": "#87d96c33", + "editorOverviewRuler.border": "#171b24", + "editorOverviewRuler.modifiedForeground": "#80bfff", + "editorOverviewRuler.addedForeground": "#87d96c", + "editorOverviewRuler.deletedForeground": "#f27983", + "editorOverviewRuler.errorForeground": "#ff6666", + "editorOverviewRuler.warningForeground": "#ffcc66", + "editorOverviewRuler.bracketMatchForeground": "#8a9199b3", + "editorOverviewRuler.wordHighlightForeground": "#80bfff66", + "editorOverviewRuler.wordHighlightStrongForeground": "#87d96c66", + "editorOverviewRuler.findMatchForeground": "#695380", + "editorError.foreground": "#ff6666", + "editorWarning.foreground": "#ffcc66", + "editorGutter.modifiedBackground": "#80bfffcc", + "editorGutter.addedBackground": "#87d96ccc", + "editorGutter.deletedBackground": "#f27983cc", + "diffEditor.insertedTextBackground": "#87d96c1f", + "diffEditor.removedTextBackground": "#f279831f", + "diffEditor.diagonalFill": "#171b24", + "editorWidget.background": "#1c212b", + "editorWidget.border": "#171b24", + "editorHoverWidget.background": "#1c212b", + "editorHoverWidget.border": "#171b24", + "editorSuggestWidget.background": "#1c212b", + "editorSuggestWidget.border": "#171b24", + "editorSuggestWidget.highlightForeground": "#ffcc66", + "editorSuggestWidget.selectedBackground": "#63759926", + "debugExceptionWidget.border": "#171b24", + "debugExceptionWidget.background": "#1c212b", + "editorMarkerNavigation.background": "#1c212b", + "peekView.border": "#63759926", + "peekViewTitle.background": "#63759926", + "peekViewTitleDescription.foreground": "#707a8c", + "peekViewTitleLabel.foreground": "#cccac2", + "peekViewEditor.background": "#1c212b", + "peekViewEditor.matchHighlightBackground": "#69538066", + "peekViewEditor.matchHighlightBorder": "#5c467266", + "peekViewResult.background": "#1c212b", + "peekViewResult.fileForeground": "#cccac2", + "peekViewResult.lineForeground": "#707a8c", + "peekViewResult.matchHighlightBackground": "#69538066", + "peekViewResult.selectionBackground": "#63759926", + "panel.background": "#1f2430", + "panel.border": "#171b24", + "panelTitle.activeBorder": "#ffcc66", + "panelTitle.activeForeground": "#cccac2", + "panelTitle.inactiveForeground": "#707a8c", + "statusBar.background": "#1f2430", + "statusBar.foreground": "#707a8c", + "statusBar.border": "#1f2430", + "statusBar.debuggingBackground": "#f29e74", + "statusBar.debuggingForeground": "#242936", + "statusBar.noFolderBackground": "#1c212b", + "statusBarItem.activeBackground": "#707a8c33", + "statusBarItem.hoverBackground": "#707a8c33", + "statusBarItem.prominentBackground": "#171b24", + "statusBarItem.prominentHoverBackground": "#00000030", + "statusBarItem.remoteBackground": "#ffcc66", + "statusBarItem.remoteForeground": "#805500", + "titleBar.activeBackground": "#1f2430", + "titleBar.activeForeground": "#cccac2", + "titleBar.inactiveBackground": "#1f2430", + "titleBar.inactiveForeground": "#707a8c", + "titleBar.border": "#1f2430", + "extensionButton.prominentForeground": "#805500", + "extensionButton.prominentBackground": "#ffcc66", + "extensionButton.prominentHoverBackground": "#fac761", + "pickerGroup.border": "#171b24", + "pickerGroup.foreground": "#707a8c80", + "debugToolBar.background": "#1c212b", + "debugIcon.breakpointForeground": "#f29e74", + "debugIcon.breakpointDisabledForeground": "#f29e7480", + "debugConsoleInputIcon.foreground": "#ffcc66", + "welcomePage.tileBackground": "#1f2430", + "welcomePage.tileShadow": "#12151cb3", + "welcomePage.progress.background": "#1a1f29", + "welcomePage.buttonBackground": "#ffcc6666", + "walkThrough.embeddedEditorBackground": "#1c212b", + "gitDecoration.modifiedResourceForeground": "#80bfffb3", + "gitDecoration.deletedResourceForeground": "#f27983b3", + "gitDecoration.untrackedResourceForeground": "#87d96cb3", + "gitDecoration.ignoredResourceForeground": "#707a8c80", + "gitDecoration.conflictingResourceForeground": "", + "gitDecoration.submoduleResourceForeground": "#dfbfffb3", + "settings.headerForeground": "#cccac2", + "settings.modifiedItemIndicator": "#80bfff", + "keybindingLabel.background": "#707a8c1a", + "keybindingLabel.foreground": "#cccac2", + "keybindingLabel.border": "#cccac21a", + "keybindingLabel.bottomBorder": "#cccac21a", + "terminal.background": "#1f2430", + "terminal.foreground": "#cccac2", + "terminal.ansiBlack": "#171b24", + "terminal.ansiRed": "#ed8274", + "terminal.ansiGreen": "#87d96c", + "terminal.ansiYellow": "#facc6e", + "terminal.ansiBlue": "#6dcbfa", + "terminal.ansiMagenta": "#dabafa", + "terminal.ansiCyan": "#90e1c6", + "terminal.ansiWhite": "#c7c7c7", + "terminal.ansiBrightBlack": "#686868", + "terminal.ansiBrightRed": "#f28779", + "terminal.ansiBrightGreen": "#d5ff80", + "terminal.ansiBrightYellow": "#ffd173", + "terminal.ansiBrightBlue": "#73d0ff", + "terminal.ansiBrightMagenta": "#dfbfff", + "terminal.ansiBrightCyan": "#95e6cb", + "terminal.ansiBrightWhite": "#ffffff" + }, + "tokenColors": [ + { + "settings": { + "background": "#1f2430", + "foreground": "#cccac2" + } + }, + { + "name": "Comment", + "scope": [ + "comment" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#b8cfe680" + } + }, + { + "name": "String", + "scope": [ + "string", + "constant.other.symbol" + ], + "settings": { + "foreground": "#d5ff80" + } + }, + { + "name": "Regular Expressions and Escape Characters", + "scope": [ + "string.regexp", + "constant.character", + "constant.other" + ], + "settings": { + "foreground": "#95e6cb" + } + }, + { + "name": "Number", + "scope": [ + "constant.numeric" + ], + "settings": { + "foreground": "#dfbfff" + } + }, + { + "name": "Built-in constants", + "scope": [ + "constant.language" + ], + "settings": { + "foreground": "#dfbfff" + } + }, + { + "name": "Variable", + "scope": [ + "variable", + "variable.parameter.function-call" + ], + "settings": { + "foreground": "#cccac2" + } + }, + { + "name": "Member Variable", + "scope": [ + "variable.member" + ], + "settings": { + "foreground": "#f28779" + } + }, + { + "name": "Language variable", + "scope": [ + "variable.language" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#5ccfe6" + } + }, + { + "name": "Storage", + "scope": [ + "storage" + ], + "settings": { + "foreground": "#ffad66" + } + }, + { + "name": "Keyword", + "scope": [ + "keyword" + ], + "settings": { + "foreground": "#ffad66" + } + }, + { + "name": "Operators", + "scope": [ + "keyword.operator" + ], + "settings": { + "foreground": "#f29e74" + } + }, + { + "name": "Separators like ; or ,", + "scope": [ + "punctuation.separator", + "punctuation.terminator" + ], + "settings": { + "foreground": "#cccac2b3" + } + }, + { + "name": "Punctuation", + "scope": [ + "punctuation.section" + ], + "settings": { + "foreground": "#cccac2" + } + }, + { + "name": "Accessor", + "scope": [ + "punctuation.accessor" + ], + "settings": { + "foreground": "#f29e74" + } + }, + { + "name": "JavaScript/TypeScript interpolation punctuation", + "scope": [ + "punctuation.definition.template-expression" + ], + "settings": { + "foreground": "#ffad66" + } + }, + { + "name": "Ruby interpolation punctuation", + "scope": [ + "punctuation.section.embedded" + ], + "settings": { + "foreground": "#ffad66" + } + }, + { + "name": "Interpolation text", + "scope": [ + "meta.embedded" + ], + "settings": { + "foreground": "#cccac2" + } + }, + { + "name": "Types fixes", + "scope": [ + "source.java storage.type", + "source.haskell storage.type", + "source.c storage.type" + ], + "settings": { + "foreground": "#73d0ff" + } + }, + { + "name": "Inherited class type", + "scope": [ + "entity.other.inherited-class" + ], + "settings": { + "foreground": "#5ccfe6" + } + }, + { + "name": "Lambda arrow", + "scope": [ + "storage.type.function" + ], + "settings": { + "foreground": "#ffad66" + } + }, + { + "name": "Java primitive variable types", + "scope": [ + "source.java storage.type.primitive" + ], + "settings": { + "foreground": "#5ccfe6" + } + }, + { + "name": "Function name", + "scope": [ + "entity.name.function" + ], + "settings": { + "foreground": "#ffd173" + } + }, + { + "name": "Function arguments", + "scope": [ + "variable.parameter", + "meta.parameter" + ], + "settings": { + "foreground": "#dfbfff" + } + }, + { + "name": "Function call", + "scope": [ + "variable.function", + "variable.annotation", + "meta.function-call.generic", + "support.function.go" + ], + "settings": { + "foreground": "#ffd173" + } + }, + { + "name": "Library function", + "scope": [ + "support.function", + "support.macro" + ], + "settings": { + "foreground": "#f28779" + } + }, + { + "name": "Imports and packages", + "scope": [ + "entity.name.import", + "entity.name.package" + ], + "settings": { + "foreground": "#d5ff80" + } + }, + { + "name": "Entity name", + "scope": [ + "entity.name" + ], + "settings": { + "foreground": "#73d0ff" + } + }, + { + "name": "Tag", + "scope": [ + "entity.name.tag", + "meta.tag.sgml" + ], + "settings": { + "foreground": "#5ccfe6" + } + }, + { + "name": "JSX Component", + "scope": [ + "support.class.component" + ], + "settings": { + "foreground": "#73d0ff" + } + }, + { + "name": "Tag start/end", + "scope": [ + "punctuation.definition.tag.end", + "punctuation.definition.tag.begin", + "punctuation.definition.tag" + ], + "settings": { + "foreground": "#5ccfe680" + } + }, + { + "name": "Tag attribute", + "scope": [ + "entity.other.attribute-name" + ], + "settings": { + "foreground": "#ffd173" + } + }, + { + "name": "Library constant", + "scope": [ + "support.constant" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#f29e74" + } + }, + { + "name": "Library class/type", + "scope": [ + "support.type", + "support.class", + "source.go storage.type" + ], + "settings": { + "foreground": "#5ccfe6" + } + }, + { + "name": "Decorators/annotation", + "scope": [ + "meta.decorator variable.other", + "meta.decorator punctuation.decorator", + "storage.type.annotation" + ], + "settings": { + "foreground": "#ffdfb3" + } + }, + { + "name": "Invalid", + "scope": [ + "invalid" + ], + "settings": { + "foreground": "#ff6666" + } + }, + { + "name": "diff.header", + "scope": [ + "meta.diff", + "meta.diff.header" + ], + "settings": { + "foreground": "#c594c5" + } + }, + { + "name": "Ruby class methods", + "scope": [ + "source.ruby variable.other.readwrite" + ], + "settings": { + "foreground": "#ffd173" + } + }, + { + "name": "CSS tag names", + "scope": [ + "source.css entity.name.tag", + "source.sass entity.name.tag", + "source.scss entity.name.tag", + "source.less entity.name.tag", + "source.stylus entity.name.tag" + ], + "settings": { + "foreground": "#73d0ff" + } + }, + { + "name": "CSS browser prefix", + "scope": [ + "source.css support.type", + "source.sass support.type", + "source.scss support.type", + "source.less support.type", + "source.stylus support.type" + ], + "settings": { + "foreground": "#b8cfe680" + } + }, + { + "name": "CSS Properties", + "scope": [ + "support.type.property-name" + ], + "settings": { + "fontStyle": "normal", + "foreground": "#5ccfe6" + } + }, + { + "name": "Search Results Numbers", + "scope": [ + "constant.numeric.line-number.find-in-files - match" + ], + "settings": { + "foreground": "#b8cfe680" + } + }, + { + "name": "Search Results Match Numbers", + "scope": [ + "constant.numeric.line-number.match" + ], + "settings": { + "foreground": "#ffad66" + } + }, + { + "name": "Search Results Lines", + "scope": [ + "entity.name.filename.find-in-files" + ], + "settings": { + "foreground": "#d5ff80" + } + }, + { + "scope": [ + "message.error" + ], + "settings": { + "foreground": "#ff6666" + } + }, + { + "name": "Markup heading", + "scope": [ + "markup.heading", + "markup.heading entity.name" + ], + "settings": { + "fontStyle": "bold", + "foreground": "#d5ff80" + } + }, + { + "name": "Markup links", + "scope": [ + "markup.underline.link", + "string.other.link" + ], + "settings": { + "foreground": "#5ccfe6" + } + }, + { + "name": "Markup Italic", + "scope": [ + "markup.italic" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#f28779" + } + }, + { + "name": "Markup Bold", + "scope": [ + "markup.bold" + ], + "settings": { + "fontStyle": "bold", + "foreground": "#f28779" + } + }, + { + "name": "Markup Bold/italic", + "scope": [ + "markup.italic markup.bold", + "markup.bold markup.italic" + ], + "settings": { + "fontStyle": "bold italic" + } + }, + { + "name": "Markup Code", + "scope": [ + "markup.raw" + ], + "settings": { + "background": "#cccac205" + } + }, + { + "name": "Markup Code Inline", + "scope": [ + "markup.raw.inline" + ], + "settings": { + "background": "#cccac20f" + } + }, + { + "name": "Markdown Separator", + "scope": [ + "meta.separator" + ], + "settings": { + "fontStyle": "bold", + "background": "#cccac20f", + "foreground": "#b8cfe680" + } + }, + { + "name": "Markup Blockquote", + "scope": [ + "markup.quote" + ], + "settings": { + "foreground": "#95e6cb", + "fontStyle": "italic" + } + }, + { + "name": "Markup List Bullet", + "scope": [ + "markup.list punctuation.definition.list.begin" + ], + "settings": { + "foreground": "#ffd173" + } + }, + { + "name": "Markup added", + "scope": [ + "markup.inserted" + ], + "settings": { + "foreground": "#87d96c" + } + }, + { + "name": "Markup modified", + "scope": [ + "markup.changed" + ], + "settings": { + "foreground": "#80bfff" + } + }, + { + "name": "Markup removed", + "scope": [ + "markup.deleted" + ], + "settings": { + "foreground": "#f27983" + } + }, + { + "name": "Markup Strike", + "scope": [ + "markup.strike" + ], + "settings": { + "foreground": "#ffdfb3" + } + }, + { + "name": "Markup Table", + "scope": [ + "markup.table" + ], + "settings": { + "background": "#cccac20f", + "foreground": "#5ccfe6" + } + }, + { + "name": "Markup Raw Inline", + "scope": [ + "text.html.markdown markup.inline.raw" + ], + "settings": { + "foreground": "#f29e74" + } + }, + { + "name": "Markdown - Line Break", + "scope": [ + "text.html.markdown meta.dummy.line-break" + ], + "settings": { + "background": "#b8cfe680", + "foreground": "#b8cfe680" + } + }, + { + "name": "Markdown - Raw Block Fenced", + "scope": [ + "punctuation.definition.markdown" + ], + "settings": { + "background": "#cccac2", + "foreground": "#b8cfe680" + } + } + ], + "semanticHighlighting": true, + "semanticTokenColors": { + "parameter.label": "#cccac2" + } +} \ No newline at end of file diff --git a/assets/themes/src/vsc/ayu/family.json b/assets/themes/src/vsc/ayu/family.json new file mode 100644 index 0000000000..8c0d0c5c55 --- /dev/null +++ b/assets/themes/src/vsc/ayu/family.json @@ -0,0 +1,18 @@ +{ + "name": "Ayu", + "author": "dempfi (Ike Ku)", + "themes": [ + { + "name": "Ayu Light", + "appearance": "light" + }, + { + "name": "Ayu Mirage", + "appearance": "dark" + }, + { + "name": "Ayu Dark", + "appearance": "dark" + } + ] +} diff --git a/assets/themes/src/vsc/dracula/family.json b/assets/themes/src/vsc/dracula/family.json new file mode 100644 index 0000000000..50d5940a7b --- /dev/null +++ b/assets/themes/src/vsc/dracula/family.json @@ -0,0 +1,10 @@ +{ + "name": "Dracula", + "author": "Zeno Rocha", + "themes": [ + { + "name": "Dracula", + "appearance": "dark" + } + ] +} diff --git a/crates/theme2/src/import.rs b/crates/theme2/src/import.rs deleted file mode 100644 index 6fe1fc705b..0000000000 --- a/crates/theme2/src/import.rs +++ /dev/null @@ -1,471 +0,0 @@ -use serde::Deserialize; - -#[derive(Deserialize, Debug)] -pub struct Theme { - #[serde(rename = "$schema")] - pub schema: String, - pub name: String, - pub author: String, - pub maintainers: Vec, - #[serde(rename = "semanticClass")] - pub semantic_class: String, - #[serde(rename = "semanticHighlighting")] - pub semantic_highlighting: bool, - // pub colors: VSCodeColors, -} - -#[derive(Debug, Deserialize)] -pub struct VSCodeColors { - #[serde(rename = "editor_foreground")] - text: String, - #[serde(rename = "editor")] - editor_background: String, -} - -#[cfg(test)] -mod tests { - use super::*; - use std::path::PathBuf; - - #[test] - fn test_deserialize_dracula() { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let root_dir = manifest_dir.parent().unwrap().parent().unwrap(); - - let mut d = root_dir.to_path_buf(); - d.push("assets/themes/src/vsc/dracula/dracula.json"); - - let data = std::fs::read_to_string(d).expect("Unable to read file"); - - let result: Theme = serde_json::from_str(&data).unwrap(); - println!("{:#?}", result); - - // Uncomment the following lines to print specific fields - println!("Name: {:?}", result.name); - println!("Author: {:?}", result.author); - } -} - -// #[derive(Debug, Deserialize)] -// pub struct VSCodeColors { -// #[serde(rename = "vsc_terminal_background")] -// terminal_background: String, -// #[serde(rename = "vsc_terminal_foreground")] -// terminal_foreground: String, -// #[serde(rename = "vsc_terminal_ansi_bright_black")] -// terminal_ansi_bright_black: String, -// #[serde(rename = "vsc_terminal_ansi_bright_red")] -// terminal_ansi_bright_red: String, -// #[serde(rename = "vsc_terminal_ansi_bright_green")] -// terminal_ansi_bright_green: String, -// #[serde(rename = "vsc_terminal_ansi_bright_yellow")] -// terminal_ansi_bright_yellow: String, -// #[serde(rename = "vsc_terminal_ansi_bright_blue")] -// terminal_ansi_bright_blue: String, -// #[serde(rename = "vsc_terminal_ansi_bright_magenta")] -// terminal_ansi_bright_magenta: String, -// #[serde(rename = "vsc_terminal_ansi_bright_cyan")] -// terminal_ansi_bright_cyan: String, -// #[serde(rename = "vsc_terminal_ansi_bright_white")] -// terminal_ansi_bright_white: String, -// #[serde(rename = "vsc_terminal_ansi_black")] -// terminal_ansi_black: String, -// #[serde(rename = "vsc_terminal_ansi_red")] -// terminal_ansi_red: String, -// #[serde(rename = "vsc_terminal_ansi_green")] -// terminal_ansi_green: String, -// #[serde(rename = "vsc_terminal_ansi_yellow")] -// terminal_ansi_yellow: String, -// #[serde(rename = "vsc_terminal_ansi_blue")] -// terminal_ansi_blue: String, -// #[serde(rename = "vsc_terminal_ansi_magenta")] -// terminal_ansi_magenta: String, -// #[serde(rename = "vsc_terminal_ansi_cyan")] -// terminal_ansi_cyan: String, -// #[serde(rename = "vsc_terminal_ansi_white")] -// terminal_ansi_white: String, -// #[serde(rename = "vsc_focus_border")] -// focus_border: String, -// #[serde(rename = "vsc_foreground")] -// foreground: String, -// #[serde(rename = "vsc_selection_background")] -// selection_background: String, -// #[serde(rename = "vsc_error_foreground")] -// error_foreground: String, -// #[serde(rename = "vsc_button_background")] -// button_background: String, -// #[serde(rename = "vsc_button_foreground")] -// button_foreground: String, -// #[serde(rename = "vsc_button_secondary_background")] -// button_secondary_background: String, -// #[serde(rename = "vsc_button_secondary_foreground")] -// button_secondary_foreground: String, -// #[serde(rename = "vsc_button_secondary_hover_background")] -// button_secondary_hover_background: String, -// #[serde(rename = "vsc_dropdown_background")] -// dropdown_background: String, -// #[serde(rename = "vsc_dropdown_border")] -// dropdown_border: String, -// #[serde(rename = "vsc_dropdown_foreground")] -// dropdown_foreground: String, -// #[serde(rename = "vsc_input_background")] -// input_background: String, -// #[serde(rename = "vsc_input_foreground")] -// input_foreground: String, -// #[serde(rename = "vsc_input_border")] -// input_border: String, -// #[serde(rename = "vsc_input_placeholder_foreground")] -// input_placeholder_foreground: String, -// #[serde(rename = "vsc_input_option_active_border")] -// input_option_active_border: String, -// #[serde(rename = "vsc_input_validation_info_border")] -// input_validation_info_border: String, -// #[serde(rename = "vsc_input_validation_warning_border")] -// input_validation_warning_border: String, -// #[serde(rename = "vsc_input_validation_error_border")] -// input_validation_error_border: String, -// #[serde(rename = "vsc_badge_foreground")] -// badge_foreground: String, -// #[serde(rename = "vsc_badge_background")] -// badge_background: String, -// #[serde(rename = "vsc_progress_bar_background")] -// progress_bar_background: String, -// #[serde(rename = "vsc_list_active_selection_background")] -// list_active_selection_background: String, -// #[serde(rename = "vsc_list_active_selection_foreground")] -// list_active_selection_foreground: String, -// #[serde(rename = "vsc_list_drop_background")] -// list_drop_background: String, -// #[serde(rename = "vsc_list_focus_background")] -// list_focus_background: String, -// #[serde(rename = "vsc_list_highlight_foreground")] -// list_highlight_foreground: String, -// #[serde(rename = "vsc_list_hover_background")] -// list_hover_background: String, -// #[serde(rename = "vsc_list_inactive_selection_background")] -// list_inactive_selection_background: String, -// #[serde(rename = "vsc_list_warning_foreground")] -// list_warning_foreground: String, -// #[serde(rename = "vsc_list_error_foreground")] -// list_error_foreground: String, -// #[serde(rename = "vsc_activity_bar_background")] -// activity_bar_background: String, -// #[serde(rename = "vsc_activity_bar_inactive_foreground")] -// activity_bar_inactive_foreground: String, -// #[serde(rename = "vsc_activity_bar_foreground")] -// activity_bar_foreground: String, -// #[serde(rename = "vsc_activity_bar_active_border")] -// activity_bar_active_border: String, -// #[serde(rename = "vsc_activity_bar_active_background")] -// activity_bar_active_background: String, -// #[serde(rename = "vsc_activity_bar_badge_background")] -// activity_bar_badge_background: String, -// #[serde(rename = "vsc_activity_bar_badge_foreground")] -// activity_bar_badge_foreground: String, -// #[serde(rename = "vsc_side_bar_background")] -// side_bar_background: String, -// #[serde(rename = "vsc_side_bar_title_foreground")] -// side_bar_title_foreground: String, -// #[serde(rename = "vsc_side_bar_section_header_background")] -// side_bar_section_header_background: String, -// #[serde(rename = "vsc_side_bar_section_header_border")] -// side_bar_section_header_border: String, -// #[serde(rename = "vsc_editor_group_border")] -// editor_group_border: String, -// #[serde(rename = "vsc_editor_group_drop_background")] -// editor_group_drop_background: String, -// #[serde(rename = "vsc_editor_group_header_tabs_background")] -// editor_group_header_tabs_background: String, -// #[serde(rename = "vsc_tab_active_background")] -// tab_active_background: String, -// #[serde(rename = "vsc_tab_active_foreground")] -// tab_active_foreground: String, -// #[serde(rename = "vsc_tab_border")] -// tab_border: String, -// #[serde(rename = "vsc_tab_active_border_top")] -// tab_active_border_top: String, -// #[serde(rename = "vsc_tab_inactive_background")] -// tab_inactive_background: String, -// #[serde(rename = "vsc_tab_inactive_foreground")] -// tab_inactive_foreground: String, -// #[serde(rename = "vsc_editor_foreground")] -// editor_foreground: String, -// #[serde(rename = "vsc_editor_background")] -// editor_background: String, -// #[serde(rename = "vsc_editor_line_number_foreground")] -// editor_line_number_foreground: String, -// #[serde(rename = "vsc_editor_selection_background")] -// editor_selection_background: String, -// #[serde(rename = "vsc_editor_selection_highlight_background")] -// editor_selection_highlight_background: String, -// #[serde(rename = "vsc_editor_fold_background")] -// editor_fold_background: String, -// #[serde(rename = "vsc_editor_word_highlight_background")] -// editor_word_highlight_background: String, -// #[serde(rename = "vsc_editor_word_highlight_strong_background")] -// editor_word_highlight_strong_background: String, -// #[serde(rename = "vsc_editor_find_match_background")] -// editor_find_match_background: String, -// #[serde(rename = "vsc_editor_find_match_highlight_background")] -// editor_find_match_highlight_background: String, -// #[serde(rename = "vsc_editor_find_range_highlight_background")] -// editor_find_range_highlight_background: String, -// #[serde(rename = "vsc_editor_hover_highlight_background")] -// editor_hover_highlight_background: String, -// #[serde(rename = "vsc_editor_line_highlight_border")] -// editor_line_highlight_border: String, -// #[serde(rename = "vsc_editor_link_active_foreground")] -// editor_link_active_foreground: String, -// #[serde(rename = "vsc_editor_range_highlight_background")] -// editor_range_highlight_background: String, -// #[serde(rename = "vsc_editor_snippet_tabstop_highlight_background")] -// editor_snippet_tabstop_highlight_background: String, -// #[serde(rename = "vsc_editor_snippet_tabstop_highlight_border")] -// editor_snippet_tabstop_highlight_border: String, -// #[serde(rename = "vsc_editor_snippet_final_tabstop_highlight_background")] -// editor_snippet_final_tabstop_highlight_background: String, -// #[serde(rename = "vsc_editor_snippet_final_tabstop_highlight_border")] -// editor_snippet_final_tabstop_highlight_border: String, -// #[serde(rename = "vsc_editor_whitespace_foreground")] -// editor_whitespace_foreground: String, -// #[serde(rename = "vsc_editor_indent_guide_background")] -// editor_indent_guide_background: String, -// #[serde(rename = "vsc_editor_indent_guide_active_background")] -// editor_indent_guide_active_background: String, -// #[serde(rename = "vsc_editor_ruler_foreground")] -// editor_ruler_foreground: String, -// #[serde(rename = "vsc_editor_code_lens_foreground")] -// editor_code_lens_foreground: String, -// #[serde(rename = "vsc_editor_bracket_highlight_foreground1")] -// editor_bracket_highlight_foreground1: String, -// #[serde(rename = "vsc_editor_bracket_highlight_foreground2")] -// editor_bracket_highlight_foreground2: String, -// #[serde(rename = "vsc_editor_bracket_highlight_foreground3")] -// editor_bracket_highlight_foreground3: String, -// #[serde(rename = "vsc_editor_bracket_highlight_foreground4")] -// editor_bracket_highlight_foreground4: String, -// #[serde(rename = "vsc_editor_bracket_highlight_foreground5")] -// editor_bracket_highlight_foreground5: String, -// #[serde(rename = "vsc_editor_bracket_highlight_foreground6")] -// editor_bracket_highlight_foreground6: String, -// #[serde(rename = "vsc_editor_bracket_highlight_unexpected_bracket_foreground")] -// editor_bracket_highlight_unexpected_bracket_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_border")] -// editor_overview_ruler_border: String, -// #[serde(rename = "vsc_editor_overview_ruler_selection_highlight_foreground")] -// editor_overview_ruler_selection_highlight_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_word_highlight_foreground")] -// editor_overview_ruler_word_highlight_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_word_highlight_strong_foreground")] -// editor_overview_ruler_word_highlight_strong_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_modified_foreground")] -// editor_overview_ruler_modified_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_added_foreground")] -// editor_overview_ruler_added_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_deleted_foreground")] -// editor_overview_ruler_deleted_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_error_foreground")] -// editor_overview_ruler_error_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_warning_foreground")] -// editor_overview_ruler_warning_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_info_foreground")] -// editor_overview_ruler_info_foreground: String, -// #[serde(rename = "vsc_editor_error_foreground")] -// editor_error_foreground: String, -// #[serde(rename = "vsc_editor_warning_foreground")] -// editor_warning_foreground: String, -// #[serde(rename = "vsc_editor_gutter_modified_background")] -// editor_gutter_modified_background: String, -// #[serde(rename = "vsc_editor_gutter_added_background")] -// editor_gutter_added_background: String, -// #[serde(rename = "vsc_editor_gutter_deleted_background")] -// editor_gutter_deleted_background: String, -// #[serde(rename = "vsc_git_decoration_modified_resource_foreground")] -// git_decoration_modified_resource_foreground: String, -// #[serde(rename = "vsc_git_decoration_deleted_resource_foreground")] -// git_decoration_deleted_resource_foreground: String, -// #[serde(rename = "vsc_git_decoration_untracked_resource_foreground")] -// git_decoration_untracked_resource_foreground: String, -// #[serde(rename = "vsc_git_decoration_ignored_resource_foreground")] -// git_decoration_ignored_resource_foreground: String, -// #[serde(rename = "vsc_git_decoration_conflicting_resource_foreground")] -// git_decoration_conflicting_resource_foreground: String, -// #[serde(rename = "vsc_diff_editor_inserted_text_background")] -// diff_editor_inserted_text_background: String, -// #[serde(rename = "vsc_diff_editor_removed_text_background")] -// diff_editor_removed_text_background: String, -// #[serde(rename = "vsc_inline_chat_region_highlight")] -// inline_chat_region_highlight: String, -// #[serde(rename = "vsc_editor_widget_background")] -// editor_widget_background: String, -// #[serde(rename = "vsc_editor_suggest_widget_background")] -// editor_suggest_widget_background: String, -// #[serde(rename = "vsc_editor_suggest_widget_foreground")] -// editor_suggest_widget_foreground: String, -// #[serde(rename = "vsc_editor_suggest_widget_selected_background")] -// editor_suggest_widget_selected_background: String, -// #[serde(rename = "vsc_editor_hover_widget_background")] -// editor_hover_widget_background: String, -// #[serde(rename = "vsc_editor_hover_widget_border")] -// editor_hover_widget_border: String, -// #[serde(rename = "vsc_editor_marker_navigation_background")] -// editor_marker_navigation_background: String, -// #[serde(rename = "vsc_peek_view_border")] -// peek_view_border: String, -// #[serde(rename = "vsc_peek_view_editor_background")] -// peek_view_editor_background: String, -// #[serde(rename = "vsc_peek_view_editor_match_highlight_background")] -// peek_view_editor_match_highlight_background: String, -// #[serde(rename = "vsc_peek_view_result_background")] -// peek_view_result_background: String, -// #[serde(rename = "vsc_peek_view_result_file_foreground")] -// peek_view_result_file_foreground: String, -// #[serde(rename = "vsc_peek_view_result_line_foreground")] -// peek_view_result_line_foreground: String, -// #[serde(rename = "vsc_peek_view_result_match_highlight_background")] -// peek_view_result_match_highlight_background: String, -// #[serde(rename = "vsc_peek_view_result_selection_background")] -// peek_view_result_selection_background: String, -// #[serde(rename = "vsc_peek_view_result_selection_foreground")] -// peek_view_result_selection_foreground: String, -// #[serde(rename = "vsc_peek_view_title_background")] -// peek_view_title_background: String, -// #[serde(rename = "vsc_peek_view_title_description_foreground")] -// peek_view_title_description_foreground: String, -// #[serde(rename = "vsc_peek_view_title_label_foreground")] -// peek_view_title_label_foreground: String, -// #[serde(rename = "vsc_merge_current_header_background")] -// merge_current_header_background: String, -// #[serde(rename = "vsc_merge_incoming_header_background")] -// merge_incoming_header_background: String, -// #[serde(rename = "vsc_editor_overview_ruler_current_content_foreground")] -// editor_overview_ruler_current_content_foreground: String, -// #[serde(rename = "vsc_editor_overview_ruler_incoming_content_foreground")] -// editor_overview_ruler_incoming_content_foreground: String, -// #[serde(rename = "vsc_panel_background")] -// panel_background: String, -// #[serde(rename = "vsc_panel_border")] -// panel_border: String, -// #[serde(rename = "vsc_panel_title_active_border")] -// panel_title_active_border: String, -// #[serde(rename = "vsc_panel_title_active_foreground")] -// panel_title_active_foreground: String, -// #[serde(rename = "vsc_panel_title_inactive_foreground")] -// panel_title_inactive_foreground: String, -// #[serde(rename = "vsc_status_bar_background")] -// status_bar_background: String, -// #[serde(rename = "vsc_status_bar_foreground")] -// status_bar_foreground: String, -// #[serde(rename = "vsc_status_bar_debugging_background")] -// status_bar_debugging_background: String, -// #[serde(rename = "vsc_status_bar_debugging_foreground")] -// status_bar_debugging_foreground: String, -// #[serde(rename = "vsc_status_bar_no_folder_background")] -// status_bar_no_folder_background: String, -// #[serde(rename = "vsc_status_bar_no_folder_foreground")] -// status_bar_no_folder_foreground: String, -// #[serde(rename = "vsc_status_bar_item_prominent_background")] -// status_bar_item_prominent_background: String, -// #[serde(rename = "vsc_status_bar_item_prominent_hover_background")] -// status_bar_item_prominent_hover_background: String, -// #[serde(rename = "vsc_status_bar_item_remote_foreground")] -// status_bar_item_remote_foreground: String, -// #[serde(rename = "vsc_status_bar_item_remote_background")] -// status_bar_item_remote_background: String, -// #[serde(rename = "vsc_title_bar_active_background")] -// title_bar_active_background: String, -// #[serde(rename = "vsc_title_bar_active_foreground")] -// title_bar_active_foreground: String, -// #[serde(rename = "vsc_title_bar_inactive_background")] -// title_bar_inactive_background: String, -// #[serde(rename = "vsc_title_bar_inactive_foreground")] -// title_bar_inactive_foreground: String, -// #[serde(rename = "vsc_extension_button_prominent_foreground")] -// extension_button_prominent_foreground: String, -// #[serde(rename = "vsc_extension_button_prominent_background")] -// extension_button_prominent_background: String, -// #[serde(rename = "vsc_extension_button_prominent_hover_background")] -// extension_button_prominent_hover_background: String, -// #[serde(rename = "vsc_picker_group_border")] -// picker_group_border: String, -// #[serde(rename = "vsc_picker_group_foreground")] -// picker_group_foreground: String, -// #[serde(rename = "vsc_debug_tool_bar_background")] -// debug_tool_bar_background: String, -// #[serde(rename = "vsc_walk_through_embedded_editor_background")] -// walk_through_embedded_editor_background: String, -// #[serde(rename = "vsc_settings_header_foreground")] -// settings_header_foreground: String, -// #[serde(rename = "vsc_settings_modified_item_indicator")] -// settings_modified_item_indicator: String, -// #[serde(rename = "vsc_settings_dropdown_background")] -// settings_dropdown_background: String, -// #[serde(rename = "vsc_settings_dropdown_foreground")] -// settings_dropdown_foreground: String, -// #[serde(rename = "vsc_settings_dropdown_border")] -// settings_dropdown_border: String, -// #[serde(rename = "vsc_settings_checkbox_background")] -// settings_checkbox_background: String, -// #[serde(rename = "vsc_settings_checkbox_foreground")] -// settings_checkbox_foreground: String, -// #[serde(rename = "vsc_settings_checkbox_border")] -// settings_checkbox_border: String, -// #[serde(rename = "vsc_settings_text_input_background")] -// settings_text_input_background: String, -// #[serde(rename = "vsc_settings_text_input_foreground")] -// settings_text_input_foreground: String, -// #[serde(rename = "vsc_settings_text_input_border")] -// settings_text_input_border: String, -// #[serde(rename = "vsc_settings_number_input_background")] -// settings_number_input_background: String, -// #[serde(rename = "vsc_settings_number_input_foreground")] -// settings_number_input_foreground: String, -// #[serde(rename = "vsc_settings_number_input_border")] -// settings_number_input_border: String, -// #[serde(rename = "vsc_breadcrumb_foreground")] -// breadcrumb_foreground: String, -// #[serde(rename = "vsc_breadcrumb_background")] -// breadcrumb_background: String, -// #[serde(rename = "vsc_breadcrumb_focus_foreground")] -// breadcrumb_focus_foreground: String, -// #[serde(rename = "vsc_breadcrumb_active_selection_foreground")] -// breadcrumb_active_selection_foreground: String, -// #[serde(rename = "vsc_breadcrumb_picker_background")] -// breadcrumb_picker_background: String, -// #[serde(rename = "vsc_list_filter_widget_background")] -// list_filter_widget_background: String, -// #[serde(rename = "vsc_list_filter_widget_outline")] -// list_filter_widget_outline: String, -// #[serde(rename = "vsc_list_filter_widget_no_matches_outline")] -// list_filter_widget_no_matches_outline: String, -// } - -// use crate::ThemeColorsRefinement; - -// struct ImportedThemeFamily { -// pub id: String, -// pub name: String, -// pub author: String, -// pub url: String, -// pub license: String, -// pub themes: Vec, -// } - -// struct ImportedThemeVariant { -// pub id: String, -// pub name: String, -// pub colors: ThemeColorsRefinement, -// } - -// pub fn try_vscode_colors_to_theme_colors(colors: VSCodeColors) -> ThemeColorsRefinement { -// let mut theme_colors = ThemeColorsRefinement::default(); - -// theme_colors -// } - -// pub fn vscode_colors_to_theme_colors(color: String) -> ThemeColorsRefinement { -// ThemeColorsRefinement { -// text: Some(color), -// ..Default::default() -// } -// } diff --git a/crates/theme2/src/theme2.rs b/crates/theme2/src/theme2.rs index 431a96c05f..0aa3542a77 100644 --- a/crates/theme2/src/theme2.rs +++ b/crates/theme2/src/theme2.rs @@ -1,7 +1,6 @@ mod colors; mod default_colors; mod default_theme; -mod import; mod registry; mod scale; mod settings; @@ -40,8 +39,7 @@ impl ActiveTheme for AppContext { } pub struct ThemeFamily { - #[allow(dead_code)] - pub(crate) id: String, + pub id: String, pub name: SharedString, pub author: SharedString, pub themes: Vec, diff --git a/crates/theme_importer/Cargo.toml b/crates/theme_importer/Cargo.toml new file mode 100644 index 0000000000..443cc2e50b --- /dev/null +++ b/crates/theme_importer/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "theme_importer" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow.workspace = true +convert_case = "0.6.0" +gpui = { package = "gpui2", path = "../gpui2" } +log.workspace = true +rust-embed.workspace = true +serde.workspace = true +simplelog = "0.9" +theme = { package = "theme2", path = "../theme2" } +uuid.workspace = true diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rs new file mode 100644 index 0000000000..82e2105e0c --- /dev/null +++ b/crates/theme_importer/src/main.rs @@ -0,0 +1,142 @@ +use std::path::PathBuf; +use std::str::FromStr; +use std::{borrow::Cow, fs::File}; + +use anyhow::{anyhow, Context, Result}; +use convert_case::Case; +use gpui::{AssetSource, SharedString}; +use log::LevelFilter; +use rust_embed::RustEmbed; +use serde::Deserialize; +use simplelog::SimpleLogger; +use theme::{default_color_scales, ThemeColorsRefinement, ThemeFamily}; + +mod vscode; + +pub(crate) fn new_theme_family(name: String, author: String) -> ThemeFamily { + ThemeFamily { + id: uuid::Uuid::new_v4().to_string(), + name: name.into(), + author: author.into(), + themes: Vec::new(), + scales: default_color_scales(), + } +} + +#[derive(Deserialize)] +struct FamilyJson { + pub name: String, + pub themes: Vec, +} + +#[derive(Deserialize)] +#[serde(rename_all = "snake_case")] +enum ThemeAppearanceJson { + Light, + Dark, +} + +#[derive(Deserialize)] +struct ThemeVariantJson { + pub name: String, + pub appearance: ThemeAppearanceJson, +} + +struct ImportedThemeFamily { + pub id: String, + pub name: String, + pub author: String, + pub url: Option, + // App should panic if we try to load a theme without a lisence + pub license: String, + pub themes: Vec, +} + +struct ImportedThemeVariant { + pub id: String, + pub name: String, + pub colors: ThemeColorsRefinement, +} + +// Load a vscode theme from json +// Load it's LICENSE from the same folder +// Create a ThemeFamily for the theme +// Create a ThemeVariant or Variants for the theme +// Output a rust file with the ThemeFamily and ThemeVariant(s) in it + +fn main() -> Result<()> { + SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger"); + + let themes_path = PathBuf::from_str("crates/theme2/src/themes")?; + + let mut theme_modules = Vec::new(); + + for theme_path in Assets.list("themes/src/vsc/")? { + let (_, theme_name) = theme_path.split_once("themes/").unwrap(); + + if theme_name == ".gitkeep" { + continue; + } + + let theme_contents = Assets::get(&theme_path) + .with_context(|| format!("theme file not found: '{theme_path}'"))?; + + // let json_theme: JsonTheme = + // serde_json::from_str(std::str::from_utf8(&theme_contents.data)?) + // .context("failed to parse legacy theme")?; + + // let (json_theme, legacy_theme) = load_theme(&theme_path)?; + + // let theme = convert_theme(json_theme, legacy_theme)?; + + // let theme_slug = theme + // .metadata + // .name + // .as_ref() + // .replace("é", "e") + // .to_case(Case::Snake); + + // let mut output_file = File::create(themes_path.join(format!("{theme_slug}.rs")))?; + + // let theme_module = format!( + // r#" + // use gpui2::rgba; + + // use crate::{{PlayerTheme, SyntaxTheme, Theme, ThemeMetadata}}; + + // pub fn {theme_slug}() -> Theme {{ + // {theme_definition} + // }} + // "#, + // theme_definition = format!("{:#?}", ThemePrinter::new(theme)) + // ); + + // output_file.write_all(theme_module.as_bytes())?; + + theme_modules.push(theme_slug); + } + + println!("Hello, world!"); + + Ok(()) +} + +#[derive(RustEmbed)] +#[folder = "../../assets"] +#[include = "themes/**/*"] +pub struct Assets; + +impl AssetSource for Assets { + fn load(&self, path: &str) -> Result> { + Self::get(path) + .map(|f| f.data) + .ok_or_else(|| anyhow!("could not find asset at path \"{}\"", path)) + } + + fn list(&self, path: &str) -> Result> { + Ok(Self::iter() + .filter(|p| p.starts_with(path)) + .map(SharedString::from) + .collect()) + } +} diff --git a/crates/theme_importer/src/temp.rs b/crates/theme_importer/src/temp.rs new file mode 100644 index 0000000000..5536a1984b --- /dev/null +++ b/crates/theme_importer/src/temp.rs @@ -0,0 +1,393 @@ +#[derive(Debug, Deserialize)] +struct VSCodeColorsOld { + #[serde(rename = "vsc_terminal_background")] + terminal_background: String, + #[serde(rename = "vsc_terminal_foreground")] + terminal_foreground: String, + #[serde(rename = "vsc_terminal_ansi_bright_black")] + terminal_ansi_bright_black: String, + #[serde(rename = "vsc_terminal_ansi_bright_red")] + terminal_ansi_bright_red: String, + #[serde(rename = "vsc_terminal_ansi_bright_green")] + terminal_ansi_bright_green: String, + #[serde(rename = "vsc_terminal_ansi_bright_yellow")] + terminal_ansi_bright_yellow: String, + #[serde(rename = "vsc_terminal_ansi_bright_blue")] + terminal_ansi_bright_blue: String, + #[serde(rename = "vsc_terminal_ansi_bright_magenta")] + terminal_ansi_bright_magenta: String, + #[serde(rename = "vsc_terminal_ansi_bright_cyan")] + terminal_ansi_bright_cyan: String, + #[serde(rename = "vsc_terminal_ansi_bright_white")] + terminal_ansi_bright_white: String, + #[serde(rename = "vsc_terminal_ansi_black")] + terminal_ansi_black: String, + #[serde(rename = "vsc_terminal_ansi_red")] + terminal_ansi_red: String, + #[serde(rename = "vsc_terminal_ansi_green")] + terminal_ansi_green: String, + #[serde(rename = "vsc_terminal_ansi_yellow")] + terminal_ansi_yellow: String, + #[serde(rename = "vsc_terminal_ansi_blue")] + terminal_ansi_blue: String, + #[serde(rename = "vsc_terminal_ansi_magenta")] + terminal_ansi_magenta: String, + #[serde(rename = "vsc_terminal_ansi_cyan")] + terminal_ansi_cyan: String, + #[serde(rename = "vsc_terminal_ansi_white")] + terminal_ansi_white: String, + #[serde(rename = "vsc_focus_border")] + focus_border: String, + #[serde(rename = "vsc_foreground")] + foreground: String, + #[serde(rename = "vsc_selection_background")] + selection_background: String, + #[serde(rename = "vsc_error_foreground")] + error_foreground: String, + #[serde(rename = "vsc_button_background")] + button_background: String, + #[serde(rename = "vsc_button_foreground")] + button_foreground: String, + #[serde(rename = "vsc_button_secondary_background")] + button_secondary_background: String, + #[serde(rename = "vsc_button_secondary_foreground")] + button_secondary_foreground: String, + #[serde(rename = "vsc_button_secondary_hover_background")] + button_secondary_hover_background: String, + #[serde(rename = "vsc_dropdown_background")] + dropdown_background: String, + #[serde(rename = "vsc_dropdown_border")] + dropdown_border: String, + #[serde(rename = "vsc_dropdown_foreground")] + dropdown_foreground: String, + #[serde(rename = "vsc_input_background")] + input_background: String, + #[serde(rename = "vsc_input_foreground")] + input_foreground: String, + #[serde(rename = "vsc_input_border")] + input_border: String, + #[serde(rename = "vsc_input_placeholder_foreground")] + input_placeholder_foreground: String, + #[serde(rename = "vsc_input_option_active_border")] + input_option_active_border: String, + #[serde(rename = "vsc_input_validation_info_border")] + input_validation_info_border: String, + #[serde(rename = "vsc_input_validation_warning_border")] + input_validation_warning_border: String, + #[serde(rename = "vsc_input_validation_error_border")] + input_validation_error_border: String, + #[serde(rename = "vsc_badge_foreground")] + badge_foreground: String, + #[serde(rename = "vsc_badge_background")] + badge_background: String, + #[serde(rename = "vsc_progress_bar_background")] + progress_bar_background: String, + #[serde(rename = "vsc_list_active_selection_background")] + list_active_selection_background: String, + #[serde(rename = "vsc_list_active_selection_foreground")] + list_active_selection_foreground: String, + #[serde(rename = "vsc_list_drop_background")] + list_drop_background: String, + #[serde(rename = "vsc_list_focus_background")] + list_focus_background: String, + #[serde(rename = "vsc_list_highlight_foreground")] + list_highlight_foreground: String, + #[serde(rename = "vsc_list_hover_background")] + list_hover_background: String, + #[serde(rename = "vsc_list_inactive_selection_background")] + list_inactive_selection_background: String, + #[serde(rename = "vsc_list_warning_foreground")] + list_warning_foreground: String, + #[serde(rename = "vsc_list_error_foreground")] + list_error_foreground: String, + #[serde(rename = "vsc_activity_bar_background")] + activity_bar_background: String, + #[serde(rename = "vsc_activity_bar_inactive_foreground")] + activity_bar_inactive_foreground: String, + #[serde(rename = "vsc_activity_bar_foreground")] + activity_bar_foreground: String, + #[serde(rename = "vsc_activity_bar_active_border")] + activity_bar_active_border: String, + #[serde(rename = "vsc_activity_bar_active_background")] + activity_bar_active_background: String, + #[serde(rename = "vsc_activity_bar_badge_background")] + activity_bar_badge_background: String, + #[serde(rename = "vsc_activity_bar_badge_foreground")] + activity_bar_badge_foreground: String, + #[serde(rename = "vsc_side_bar_background")] + side_bar_background: String, + #[serde(rename = "vsc_side_bar_title_foreground")] + side_bar_title_foreground: String, + #[serde(rename = "vsc_side_bar_section_header_background")] + side_bar_section_header_background: String, + #[serde(rename = "vsc_side_bar_section_header_border")] + side_bar_section_header_border: String, + #[serde(rename = "vsc_editor_group_border")] + editor_group_border: String, + #[serde(rename = "vsc_editor_group_drop_background")] + editor_group_drop_background: String, + #[serde(rename = "vsc_editor_group_header_tabs_background")] + editor_group_header_tabs_background: String, + #[serde(rename = "vsc_tab_active_background")] + tab_active_background: String, + #[serde(rename = "vsc_tab_active_foreground")] + tab_active_foreground: String, + #[serde(rename = "vsc_tab_border")] + tab_border: String, + #[serde(rename = "vsc_tab_active_border_top")] + tab_active_border_top: String, + #[serde(rename = "vsc_tab_inactive_background")] + tab_inactive_background: String, + #[serde(rename = "vsc_tab_inactive_foreground")] + tab_inactive_foreground: String, + #[serde(rename = "vsc_editor_foreground")] + editor_foreground: String, + #[serde(rename = "vsc_editor_background")] + editor_background: String, + #[serde(rename = "vsc_editor_line_number_foreground")] + editor_line_number_foreground: String, + #[serde(rename = "vsc_editor_selection_background")] + editor_selection_background: String, + #[serde(rename = "vsc_editor_selection_highlight_background")] + editor_selection_highlight_background: String, + #[serde(rename = "vsc_editor_fold_background")] + editor_fold_background: String, + #[serde(rename = "vsc_editor_word_highlight_background")] + editor_word_highlight_background: String, + #[serde(rename = "vsc_editor_word_highlight_strong_background")] + editor_word_highlight_strong_background: String, + #[serde(rename = "vsc_editor_find_match_background")] + editor_find_match_background: String, + #[serde(rename = "vsc_editor_find_match_highlight_background")] + editor_find_match_highlight_background: String, + #[serde(rename = "vsc_editor_find_range_highlight_background")] + editor_find_range_highlight_background: String, + #[serde(rename = "vsc_editor_hover_highlight_background")] + editor_hover_highlight_background: String, + #[serde(rename = "vsc_editor_line_highlight_border")] + editor_line_highlight_border: String, + #[serde(rename = "vsc_editor_link_active_foreground")] + editor_link_active_foreground: String, + #[serde(rename = "vsc_editor_range_highlight_background")] + editor_range_highlight_background: String, + #[serde(rename = "vsc_editor_snippet_tabstop_highlight_background")] + editor_snippet_tabstop_highlight_background: String, + #[serde(rename = "vsc_editor_snippet_tabstop_highlight_border")] + editor_snippet_tabstop_highlight_border: String, + #[serde(rename = "vsc_editor_snippet_final_tabstop_highlight_background")] + editor_snippet_final_tabstop_highlight_background: String, + #[serde(rename = "vsc_editor_snippet_final_tabstop_highlight_border")] + editor_snippet_final_tabstop_highlight_border: String, + #[serde(rename = "vsc_editor_whitespace_foreground")] + editor_whitespace_foreground: String, + #[serde(rename = "vsc_editor_indent_guide_background")] + editor_indent_guide_background: String, + #[serde(rename = "vsc_editor_indent_guide_active_background")] + editor_indent_guide_active_background: String, + #[serde(rename = "vsc_editor_ruler_foreground")] + editor_ruler_foreground: String, + #[serde(rename = "vsc_editor_code_lens_foreground")] + editor_code_lens_foreground: String, + #[serde(rename = "vsc_editor_bracket_highlight_foreground1")] + editor_bracket_highlight_foreground1: String, + #[serde(rename = "vsc_editor_bracket_highlight_foreground2")] + editor_bracket_highlight_foreground2: String, + #[serde(rename = "vsc_editor_bracket_highlight_foreground3")] + editor_bracket_highlight_foreground3: String, + #[serde(rename = "vsc_editor_bracket_highlight_foreground4")] + editor_bracket_highlight_foreground4: String, + #[serde(rename = "vsc_editor_bracket_highlight_foreground5")] + editor_bracket_highlight_foreground5: String, + #[serde(rename = "vsc_editor_bracket_highlight_foreground6")] + editor_bracket_highlight_foreground6: String, + #[serde(rename = "vsc_editor_bracket_highlight_unexpected_bracket_foreground")] + editor_bracket_highlight_unexpected_bracket_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_border")] + editor_overview_ruler_border: String, + #[serde(rename = "vsc_editor_overview_ruler_selection_highlight_foreground")] + editor_overview_ruler_selection_highlight_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_word_highlight_foreground")] + editor_overview_ruler_word_highlight_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_word_highlight_strong_foreground")] + editor_overview_ruler_word_highlight_strong_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_modified_foreground")] + editor_overview_ruler_modified_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_added_foreground")] + editor_overview_ruler_added_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_deleted_foreground")] + editor_overview_ruler_deleted_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_error_foreground")] + editor_overview_ruler_error_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_warning_foreground")] + editor_overview_ruler_warning_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_info_foreground")] + editor_overview_ruler_info_foreground: String, + #[serde(rename = "vsc_editor_error_foreground")] + editor_error_foreground: String, + #[serde(rename = "vsc_editor_warning_foreground")] + editor_warning_foreground: String, + #[serde(rename = "vsc_editor_gutter_modified_background")] + editor_gutter_modified_background: String, + #[serde(rename = "vsc_editor_gutter_added_background")] + editor_gutter_added_background: String, + #[serde(rename = "vsc_editor_gutter_deleted_background")] + editor_gutter_deleted_background: String, + #[serde(rename = "vsc_git_decoration_modified_resource_foreground")] + git_decoration_modified_resource_foreground: String, + #[serde(rename = "vsc_git_decoration_deleted_resource_foreground")] + git_decoration_deleted_resource_foreground: String, + #[serde(rename = "vsc_git_decoration_untracked_resource_foreground")] + git_decoration_untracked_resource_foreground: String, + #[serde(rename = "vsc_git_decoration_ignored_resource_foreground")] + git_decoration_ignored_resource_foreground: String, + #[serde(rename = "vsc_git_decoration_conflicting_resource_foreground")] + git_decoration_conflicting_resource_foreground: String, + #[serde(rename = "vsc_diff_editor_inserted_text_background")] + diff_editor_inserted_text_background: String, + #[serde(rename = "vsc_diff_editor_removed_text_background")] + diff_editor_removed_text_background: String, + #[serde(rename = "vsc_inline_chat_region_highlight")] + inline_chat_region_highlight: String, + #[serde(rename = "vsc_editor_widget_background")] + editor_widget_background: String, + #[serde(rename = "vsc_editor_suggest_widget_background")] + editor_suggest_widget_background: String, + #[serde(rename = "vsc_editor_suggest_widget_foreground")] + editor_suggest_widget_foreground: String, + #[serde(rename = "vsc_editor_suggest_widget_selected_background")] + editor_suggest_widget_selected_background: String, + #[serde(rename = "vsc_editor_hover_widget_background")] + editor_hover_widget_background: String, + #[serde(rename = "vsc_editor_hover_widget_border")] + editor_hover_widget_border: String, + #[serde(rename = "vsc_editor_marker_navigation_background")] + editor_marker_navigation_background: String, + #[serde(rename = "vsc_peek_view_border")] + peek_view_border: String, + #[serde(rename = "vsc_peek_view_editor_background")] + peek_view_editor_background: String, + #[serde(rename = "vsc_peek_view_editor_match_highlight_background")] + peek_view_editor_match_highlight_background: String, + #[serde(rename = "vsc_peek_view_result_background")] + peek_view_result_background: String, + #[serde(rename = "vsc_peek_view_result_file_foreground")] + peek_view_result_file_foreground: String, + #[serde(rename = "vsc_peek_view_result_line_foreground")] + peek_view_result_line_foreground: String, + #[serde(rename = "vsc_peek_view_result_match_highlight_background")] + peek_view_result_match_highlight_background: String, + #[serde(rename = "vsc_peek_view_result_selection_background")] + peek_view_result_selection_background: String, + #[serde(rename = "vsc_peek_view_result_selection_foreground")] + peek_view_result_selection_foreground: String, + #[serde(rename = "vsc_peek_view_title_background")] + peek_view_title_background: String, + #[serde(rename = "vsc_peek_view_title_description_foreground")] + peek_view_title_description_foreground: String, + #[serde(rename = "vsc_peek_view_title_label_foreground")] + peek_view_title_label_foreground: String, + #[serde(rename = "vsc_merge_current_header_background")] + merge_current_header_background: String, + #[serde(rename = "vsc_merge_incoming_header_background")] + merge_incoming_header_background: String, + #[serde(rename = "vsc_editor_overview_ruler_current_content_foreground")] + editor_overview_ruler_current_content_foreground: String, + #[serde(rename = "vsc_editor_overview_ruler_incoming_content_foreground")] + editor_overview_ruler_incoming_content_foreground: String, + #[serde(rename = "vsc_panel_background")] + panel_background: String, + #[serde(rename = "vsc_panel_border")] + panel_border: String, + #[serde(rename = "vsc_panel_title_active_border")] + panel_title_active_border: String, + #[serde(rename = "vsc_panel_title_active_foreground")] + panel_title_active_foreground: String, + #[serde(rename = "vsc_panel_title_inactive_foreground")] + panel_title_inactive_foreground: String, + #[serde(rename = "vsc_status_bar_background")] + status_bar_background: String, + #[serde(rename = "vsc_status_bar_foreground")] + status_bar_foreground: String, + #[serde(rename = "vsc_status_bar_debugging_background")] + status_bar_debugging_background: String, + #[serde(rename = "vsc_status_bar_debugging_foreground")] + status_bar_debugging_foreground: String, + #[serde(rename = "vsc_status_bar_no_folder_background")] + status_bar_no_folder_background: String, + #[serde(rename = "vsc_status_bar_no_folder_foreground")] + status_bar_no_folder_foreground: String, + #[serde(rename = "vsc_status_bar_item_prominent_background")] + status_bar_item_prominent_background: String, + #[serde(rename = "vsc_status_bar_item_prominent_hover_background")] + status_bar_item_prominent_hover_background: String, + #[serde(rename = "vsc_status_bar_item_remote_foreground")] + status_bar_item_remote_foreground: String, + #[serde(rename = "vsc_status_bar_item_remote_background")] + status_bar_item_remote_background: String, + #[serde(rename = "vsc_title_bar_active_background")] + title_bar_active_background: String, + #[serde(rename = "vsc_title_bar_active_foreground")] + title_bar_active_foreground: String, + #[serde(rename = "vsc_title_bar_inactive_background")] + title_bar_inactive_background: String, + #[serde(rename = "vsc_title_bar_inactive_foreground")] + title_bar_inactive_foreground: String, + #[serde(rename = "vsc_extension_button_prominent_foreground")] + extension_button_prominent_foreground: String, + #[serde(rename = "vsc_extension_button_prominent_background")] + extension_button_prominent_background: String, + #[serde(rename = "vsc_extension_button_prominent_hover_background")] + extension_button_prominent_hover_background: String, + #[serde(rename = "vsc_picker_group_border")] + picker_group_border: String, + #[serde(rename = "vsc_picker_group_foreground")] + picker_group_foreground: String, + #[serde(rename = "vsc_debug_tool_bar_background")] + debug_tool_bar_background: String, + #[serde(rename = "vsc_walk_through_embedded_editor_background")] + walk_through_embedded_editor_background: String, + #[serde(rename = "vsc_settings_header_foreground")] + settings_header_foreground: String, + #[serde(rename = "vsc_settings_modified_item_indicator")] + settings_modified_item_indicator: String, + #[serde(rename = "vsc_settings_dropdown_background")] + settings_dropdown_background: String, + #[serde(rename = "vsc_settings_dropdown_foreground")] + settings_dropdown_foreground: String, + #[serde(rename = "vsc_settings_dropdown_border")] + settings_dropdown_border: String, + #[serde(rename = "vsc_settings_checkbox_background")] + settings_checkbox_background: String, + #[serde(rename = "vsc_settings_checkbox_foreground")] + settings_checkbox_foreground: String, + #[serde(rename = "vsc_settings_checkbox_border")] + settings_checkbox_border: String, + #[serde(rename = "vsc_settings_text_input_background")] + settings_text_input_background: String, + #[serde(rename = "vsc_settings_text_input_foreground")] + settings_text_input_foreground: String, + #[serde(rename = "vsc_settings_text_input_border")] + settings_text_input_border: String, + #[serde(rename = "vsc_settings_number_input_background")] + settings_number_input_background: String, + #[serde(rename = "vsc_settings_number_input_foreground")] + settings_number_input_foreground: String, + #[serde(rename = "vsc_settings_number_input_border")] + settings_number_input_border: String, + #[serde(rename = "vsc_breadcrumb_foreground")] + breadcrumb_foreground: String, + #[serde(rename = "vsc_breadcrumb_background")] + breadcrumb_background: String, + #[serde(rename = "vsc_breadcrumb_focus_foreground")] + breadcrumb_focus_foreground: String, + #[serde(rename = "vsc_breadcrumb_active_selection_foreground")] + breadcrumb_active_selection_foreground: String, + #[serde(rename = "vsc_breadcrumb_picker_background")] + breadcrumb_picker_background: String, + #[serde(rename = "vsc_list_filter_widget_background")] + list_filter_widget_background: String, + #[serde(rename = "vsc_list_filter_widget_outline")] + list_filter_widget_outline: String, + #[serde(rename = "vsc_list_filter_widget_no_matches_outline")] + list_filter_widget_no_matches_outline: String, +} diff --git a/crates/theme_importer/src/vscode.rs b/crates/theme_importer/src/vscode.rs new file mode 100644 index 0000000000..559d6eb4b7 --- /dev/null +++ b/crates/theme_importer/src/vscode.rs @@ -0,0 +1,80 @@ +use std::path::{Path, PathBuf}; + +use anyhow::Result; +use serde::Deserialize; +use theme::{default_color_scales, ColorScales, ThemeFamily}; + +#[derive(Deserialize, Debug)] +pub struct VSCodeTheme { + #[serde(rename = "$schema")] + pub schema: String, + pub name: String, + pub author: String, + pub maintainers: Vec, + #[serde(rename = "semanticClass")] + pub semantic_class: String, + #[serde(rename = "semanticHighlighting")] + pub semantic_highlighting: bool, + pub colors: VSCodeColors, +} + +#[derive(Debug, Deserialize)] +pub struct VSCodeColors { + #[serde(rename = "editor.foreground")] + text: String, + #[serde(rename = "editor.background")] + editor: String, +} + +pub(crate) fn new_theme_family_from_vsc(path: &Path) -> Result { + let path_str = path.to_str().unwrap(); + let family_name = path_str.split('/').last().unwrap(); + + let mut json_files: Vec = Vec::new(); + + if path.is_dir() { + for entry in std::fs::read_dir(path).unwrap() { + let entry = entry.unwrap(); + let path = entry.path(); + if path.is_file() { + if let Some(extension) = path.extension() { + if extension == "json" { + json_files.push(path.file_name().unwrap().to_str().unwrap().to_string()); + } + } + } + } + } else { + anyhow::bail!("Path is not a directory"); + } + + let mut theme_family = ThemeFamily { + id: uuid::Uuid::new_v4().to_string(), + name: family_name.into(), + author: "New Theme Family".into(), + themes: Vec::new(), + scales: default_color_scales(), + }; + + Ok(theme_family) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::path::PathBuf; + + #[test] + fn test_deserialize_theme() { + let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + let root_dir = manifest_dir.parent().unwrap().parent().unwrap(); + + let mut d = root_dir.to_path_buf(); + d.push("assets/themes/src/vsc/dracula/dracula.json"); + + let data = std::fs::read_to_string(d).expect("Unable to read file"); + + let result: Theme = serde_json::from_str(&data).unwrap(); + println!("{:#?}", result); + } +}