local util = require("farout.util") local M = {} --- @param colors ColorScheme function M.generate(colors) local sublime = util.template(M.template, colors) return sublime end -- vim.schedule(function() -- local config = require("farout.config") -- config.setup({ style = "storm" }) -- local colors = require("farout.colors").setup() -- -- local lookup = {} -- -- local function process(cc, parent) -- for k, v in pairs(cc) do -- if type(v) == "string" then -- if v:sub(1, 1) == "#" then -- lookup[v] = (parent and (parent .. ".") or "") .. k -- end -- else -- process(v, (parent and (parent .. ".") or "") .. k) -- end -- end -- end -- process(colors) -- for c, n in pairs(lookup) do -- M.template = M.template:gsub(c, "${" .. n .. "}") -- end -- d(lookup) -- vim.notify(M.template) -- end) -- Largely based off https://github.com/enkia/enki-theme M.template = [[ author Tyler Hallada (http://github.com/thallada) colorSpaceName sRGB name FarOut semanticClass enki.theme.tokyo settings settings activeGuide #363b54 background ${bg} caret #DBC08A findHighlight #ffa300 findHighlightForeground #000000 foreground ${fg} guide #4f4f5e40 gutterForeground #3b415caa inactiveSelection #282833 invisibles #4f4f5e lineHighlight #00000030 selection #9D599D40 selectionBorder #9D599D shadow #00000010 stackGuide #4f4f5e60 tagsOptions underline name Italics - Comments, Storage, Keyword Flow, Vue attributes, Decorators scope comment, meta.var.expr storage.type, keyword.control.flow, meta.directive.vue punctuation.separator.key-value.html, meta.directive.vue entity.other.attribute-name.html, tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js, storage.modifier settings fontStyle italic name Comment scope comment, comment.block.documentation, punctuation.definition.comment settings foreground ${comment} name Comment Doc scope comment.block.documentation variable, comment.block.documentation storage, comment.block.documentation punctuation, comment.block.documentation keyword, comment.block.documentation support, comment.block.documentation markup, comment.block.documentation markup.inline.raw.string.markdown, keyword.other.phpdoc.php settings foreground ${comment} name Number, Boolean, Undefined, Null scope variable.other.constant, punctuation.definition.constant, constant.language, constant.numeric, support.constant settings foreground ${orange} name String, Symbols, Markup Heading scope meta.property.lua,string.unquoted.key.lua,support.other.metaproperty.lua,support.other.metaproperty.lua,constant.other.symbol, constant.other.key, markup.heading, meta.attribute-selector settings fontStyle foreground ${green1} name String scope string settings fontStyle foreground ${green} name Colors scope constant.other.color, constant.other.color.rgb-value.hex punctuation.definition.constant settings foreground #9aa5ce name Invalid scope invalid, invalid.illegal settings foreground ${red} name Invalid deprecated scope invalid.deprecated settings foreground ${magenta} name Storage Type scope storage.type settings foreground ${magenta} name Storage - modifier, var, const, let scope meta.var.expr storage.type, storage.modifier settings foreground ${purple} name Interpolation scope punctuation.definition.template-expression, punctuation.section.embedded settings foreground ${cyan} name Spread scope keyword.operator.spread, keyword.operator.rest settings fontStyle bold foreground ${red} name Operator, Misc scope keyword.operator, keyword.control.as, keyword.other, keyword.operator.bitwise.shift, punctuation, punctuation.definition.constant.markdown, punctuation.definition.string, punctuation.support.type.property-name, text.html.vue-html meta.tag, punctuation.definition.keyword, punctuation.terminator.rule, punctuation.definition.entity, punctuation.definition.tag, punctuation.separator.inheritance.php, punctuation.definition.tag.html, keyword.other.template, keyword.other.substitution, entity.name.operator, text.html.vue meta.tag.block.any.html, text.html.vue meta.tag.inline.any.html, text.html.vue meta.tag.other.html, text.html.twig meta.tag.inline.any.html, text.html.twig meta.tag.block.any.html, text.html.twig meta.tag.structure.any.html, text.html.twig meta.tag.any.html settings foreground ${blue5} name Import, Export, From, Default scope keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.default, meta.import keyword.other settings foreground ${cyan} name Keyword scope keyword, keyword.control, keyword.other.important settings foreground ${magenta} name Keyword SQL scope keyword.other.DML settings foreground ${cyan} name Keyword Operator Logical, Arrow, Ternary, Comparison scope keyword.operator.logical, storage.type.function, keyword.operator.bitwise, keyword.operator.ternary, keyword.operator.comparison, keyword.operator.relational, keyword.operator.or.regexp settings foreground ${magenta} name Tag scope entity.name.tag, entity.name.tag support.class.component, meta.tag settings foreground ${red} name Tag Punctuation scope punctuation.definition.tag, punctuation.definition.tag.html, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html settings foreground #ba3c97 name Blade scope keyword.blade, entity.name.function.blade settings foreground ${blue} name PHP - Embedded Tag scope punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php settings foreground ${blue2} name Smarty - Twig tag - Blade scope punctuation.definition.variable.smarty, punctuation.section.embedded.begin.smarty, punctuation.section.embedded.end.smarty, meta.tag.template.value.twig, punctuation.section.tag.twig, meta.tag.expression.twig, punctuation.definition.tag.expression.twig, punctuation.definition.tag.output.twig, variable.parameter.smarty settings foreground #7DCFFF name Smarty - Twig variable - function scope variable.other.property.twig, support.function.twig, meta.function-call.twig, keyword.control.twig, keyword.control.smarty, keyword.operator.other.twig, keyword.operator.comparison.twig, support.function.functions.twig, support.function.functions.twig, keyword.operator.assignment.twig, support.function.filters.twig, support.function.built-in.smarty, keyword.operator.smarty, text.blade text.html.blade custom.compiler.blade.php punctuation.section.embedded.php entity.name.tag.block.any.html, text.blade text.html.blade custom.compiler.blade.php punctuation.section.embedded.php constant.other.inline-data.html, text.blade text.html.blade custom.compiler.blade.php support.function constant.other.inline-data.html settings foreground ${blue1} name Globals - PHP Constants etc scope constant.other.php, variable.other.global.safer, variable.other.global.safer punctuation.definition.variable, variable.other.global, variable.other.global punctuation.definition.variable, constant.other settings foreground ${warning} name Variables scope variable, support.variable, string constant.other.placeholder settings foreground ${fg} name Object Variable scope variable.other.object, support.module.node settings foreground ${fg} name Object Key scope meta.object-literal.key, meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js, string.alias.graphql, string.unquoted.graphql, string.unquoted.alias.graphql, meta.field.declaration.ts variable.object.property settings foreground ${green1} name Object Property scope variable.other.property, support.variable.property, support.variable.property.dom, meta.function-call variable.other.object.property, variable.language.prototype, meta.property.object, variable.other.member settings foreground ${cyan} name Object Property scope variable.other.object.property settings foreground ${fg} name Object Literal Member lvl 3 (Vue Prop Validation) scope meta.objectliteral meta.object.member meta.objectliteral meta.object.member meta.objectliteral meta.object.member meta.object-literal.key settings foreground ${green2} name C-related Block Level Variables scope source.cpp meta.block variable.other settings foreground ${red} name Other Variable scope support.other.variable settings foreground ${red} name Methods scope meta.class-method.js entity.name.function.js, entity.name.method.js, variable.function.constructor, keyword.other.special-method, storage.type.cs settings foreground ${blue} name Function Definition scope entity.name.function, meta.function-call, meta.function-call entity.name.function, variable.function, meta.definition.method entity.name.function, meta.object-literal entity.name.function settings foreground ${blue} name Function Argument scope variable.parameter.function.language.special, variable.parameter, meta.function.parameters punctuation.definition.variable, meta.function.parameter variable settings foreground ${warning} name Constant, Tag Attribute scope keyword.other.type.php, storage.type.php, constant.character, constant.escape, keyword.other.unit settings foreground ${magenta} name Variable Definition scope meta.definition.variable variable.other.constant, meta.definition.variable variable.other.readwrite, variable.other.declaration settings foreground ${magenta} name Inherited Class scope entity.other.inherited-class settings fontStyle foreground ${magenta} name Class, Support, DOM, etc scope support.class, support.type, variable.other.readwrite.alias, support.orther.namespace.use.php, meta.use.php, support.other.namespace.php, support.type.sys-types, support.variable.dom, support.constant.math, support.type.object.module, support.constant.json, entity.name.namespace, meta.import.qualifier, entity.name.class settings foreground ${blue2} name Class Name scope entity.name settings foreground ${fg} name Support Function scope support.function settings foreground ${blue1} name CSS Class and Support scope source.css support.type.property-name, source.sass support.type.property-name, source.scss support.type.property-name, source.less support.type.property-name, source.stylus support.type.property-name, source.postcss support.type.property-name, support.type.property-name.css, support.type.vendored.property-name, support.type.map.key settings foreground ${blue} name CSS Font scope support.constant.font-name, meta.definition.variable settings foreground ${green} name CSS Class scope entity.other.attribute-name.class, meta.at-rule.mixin.scss entity.name.function.scss settings foreground ${green} name CSS ID scope entity.other.attribute-name.id settings foreground #fc7b7b name CSS Tag scope entity.name.tag.css, entity.name.tag.reference, entity.name.tag.scss settings foreground ${blue2} name CSS Tag Reference scope entity.name.tag.reference settings foreground ${warning} name CSS Property Separator scope meta.property-list punctuation.separator.key-value settings foreground #9abdf5 name CSS Punctuation scope meta.property-list, punctuation.definition.entity.css settings foreground ${warning} name SCSS @ scope meta.at-rule.mixin keyword.control.at-rule.mixin, meta.at-rule.include entity.name.function.scss, meta.at-rule.include keyword.control.at-rule.include settings foreground ${magenta} name SCSS Mixins, Extends, Include Keyword scope keyword.control.at-rule.include punctuation.definition.keyword, keyword.control.at-rule.mixin punctuation.definition.keyword, meta.at-rule.include keyword.control.at-rule.include, keyword.control.at-rule.extend punctuation.definition.keyword, meta.at-rule.extend keyword.control.at-rule.extend, entity.other.attribute-name.placeholder.css punctuation.definition.entity.css, meta.at-rule.media keyword.control.at-rule.media, meta.at-rule.mixin keyword.control.at-rule.mixin, meta.at-rule.function keyword.control.at-rule.function, keyword.control punctuation.definition.keyword, meta.at-rule.import.scss entity.other.attribute-name.placeholder.scss punctuation.definition.entity.scss, meta.at-rule.import.scss keyword.control.at-rule.import.scss settings foreground ${purple} name SCSS Include Mixin Argument scope meta.property-list meta.at-rule.include settings foreground ${fg} name CSS value scope support.constant.property-value settings foreground ${orange} name Sub-methods scope entity.name.module.js, variable.import.parameter.js, variable.other.class.js settings foreground ${fg} name Language methods scope variable.language settings foreground ${red} name Variable punctuation scope variable.other punctuation.definition.variable settings foreground ${fg} name Keyword this with Punctuation, ES7 Bind Operator scope source.js constant.other.object.key.js string.unquoted.label.js, variable.language.this punctuation.definition.variable, keyword.other.this settings foreground ${red} name HTML Attributes scope entity.other.attribute-name, text.html.basic entity.other.attribute-name.html, text.html.basic entity.other.attribute-name, text.blade entity.other.attribute-name.class, text.html.smarty entity.other.attribute-name.class settings foreground ${magenta} name Vue Template attributes scope meta.directive.vue punctuation.separator.key-value.html, meta.directive.vue entity.other.attribute-name.html settings foreground ${magenta} name Vue Template attribute separator scope meta.directive.vue punctuation.separator.key-value.html settings foreground ${blue5} name CSS IDs scope source.sass keyword.control settings foreground ${blue} name CSS psuedo selectors scope entity.other.attribute-name.pseudo-class, entity.other.attribute-name.pseudo-element, entity.other.attribute-name.placeholder, meta.property-list meta.property-value settings foreground ${magenta} name Inserted scope markup.inserted settings foreground ${git.add} name Deleted scope markup.deleted settings foreground ${git.delete} name Changed scope markup.changed settings foreground ${git.change} name Regular Expressions scope string.regexp settings foreground ${blue6} name Regular Expressions - Punctuation scope punctuation.definition.group settings foreground ${red} name Regular Expressions - Character Class scope constant.other.character-class.regexp settings foreground ${magenta} name Regular Expressions - Character Class Set scope constant.other.character-class.set.regexp, punctuation.definition.character-class.regexp settings foreground ${warning} name Regular Expressions - Quantifier scope keyword.operator.quantifier.regexp settings foreground ${blue5} name Regular Expressions - Backslash scope constant.character.escape.backslash settings foreground ${fg} name Escape Characters scope constant.character.escape settings foreground ${blue5} name Decorators scope tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js settings foreground ${blue} name CSS Units scope keyword.other.unit settings foreground ${red} name JSON Key - Level 0 scope source.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json string.quoted.double.json settings foreground ${blue} name JSON Key - Level 1 scope source.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json settings foreground ${blue2} name JSON Key - Level 2 scope source.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json settings foreground ${cyan} name JSON Key - Level 3 scope source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json settings foreground ${magenta} name JSON Key - Level 4 scope source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json settings foreground ${warning} name JSON Key - Level 5 scope source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json settings foreground ${blue2} name JSON Key - Level 6 scope source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json settings foreground ${green1} name JSON Key - Level 7 scope source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json settings foreground ${red} name JSON Key - Level 8 scope source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json punctuation.definition.string.end.json settings foreground ${green} name JSON Key - value scope source.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json settings foreground ${green} name Plain Punctuation scope punctuation.definition.list_item.markdown settings foreground #9abdf5 name Block Punctuation scope meta.block, meta.brace, punctuation.definition.block, punctuation.definition.use, punctuation.definition.group.shell, punctuation.definition.class, punctuation.definition.begin.bracket, punctuation.definition.end.bracket, punctuation.definition.parameters, punctuation.definition.arguments, punctuation.definition.dictionary, punctuation.definition.array, punctuation.section settings foreground #9abdf5 name Markdown - Plain scope meta.jsx.children, meta.embedded.block settings foreground ${fg} name HTML text scope text.html settings foreground #9aa5ce name Markdown - Markup Raw Inline scope text.html.markdown markup.inline.raw.markdown settings foreground ${magenta} name Markdown - Markup Raw Inline Punctuation scope text.html.markdown markup.inline.raw.markdown punctuation.definition.raw.markdown settings foreground #4E5579 name Markdown - Heading 1 scope heading.1.markdown entity.name, heading.1.markdown punctuation.definition.heading.markdown settings fontStyle bold foreground ${blue5} name Markdown - Heading 2 scope heading.2.markdown entity.name, heading.2.markdown punctuation.definition.heading.markdown settings fontStyle bold foreground #61bdf2 name Markdown - Heading 3 scope heading.3.markdown entity.name, heading.3.markdown punctuation.definition.heading.markdown settings fontStyle bold foreground ${blue} name Markdown - Heading 4 scope heading.4.markdown entity.name, heading.4.markdown punctuation.definition.heading.markdown settings fontStyle bold foreground #6d91de name Markdown - Heading 5 scope heading.5.markdown entity.name, heading.5.markdown punctuation.definition.heading.markdown settings fontStyle bold foreground #9aa5ce name Markdown - Heading 6 scope heading.6.markdown entity.name, heading.6.markdown punctuation.definition.heading.markdown settings fontStyle bold foreground #747ca1 name Markup - Italic scope markup.italic, markup.italic punctuation settings fontStyle italic foreground ${fg} name Markup - Bold scope markup.bold, markup.bold punctuation settings fontStyle bold foreground ${fg} name Markup - Bold-Italic scope markup.bold markup.italic, markup.bold markup.italic punctuation settings fontStyle bold italic foreground ${fg} name Markup - Underline scope markup.underline, markup.underline punctuation settings fontStyle underline name Markdown - Blockquote scope markup.quote punctuation.definition.blockquote.markdown settings foreground #4e5579 name Markup - Quote scope markup.quote settings fontStyle italic name Markdown - Link scope string.other.link, markup.underline.link, constant.other.reference.link.markdown, string.other.link.description.title.markdown settings foreground ${green1} name Markdown - Fenced Code Block scope markup.fenced_code.block.markdown, markup.inline.raw.string.markdown, variable.language.fenced.markdown settings foreground ${blue5} name Markdown - Separator scope meta.separator settings fontStyle bold foreground #444b6a name Markup - Table scope markup.table settings foreground #c0cefc name Token - Info scope token.info-token settings foreground ${blue2} name Token - Warn scope token.warn-token settings foreground #ffdb69 name Token - Error scope token.error-token settings foreground ${red1} name Token - Debug scope token.debug-token settings foreground #b267e6 name Apache Tag scope entity.tag.apacheconf settings foreground ${red} name Preprocessor scope meta.preprocessor settings foreground ${green1} name ENV value scope source.env settings foreground ${blue} uuid 06f855e3-9fb7-4fb1-b790-aef06065f34e ]] return M