Compare commits

...

5 Commits

5 changed files with 263 additions and 239 deletions

View File

@ -8,37 +8,37 @@ local M = {}
-- Default scheme options -- Default scheme options
M.scheme_options = { M.scheme_options = {
variant = "blackhole", variant = "blackhole",
disable = { disable = {
background = false, background = false,
endOfBuffer = true, endOfBuffer = true,
}, },
custom_colors = {} custom_colors = {}
} }
-- Set custom options to the editor -- Set custom options to the editor
--@param opts table: custom options for editor --@param opts table: custom options for editor
function M.set_options(opts) function M.set_options(opts)
local options = opts or {} local options = opts or {}
if type(options) == "table" then if type(options) == "table" then
local new_sets = vim.tbl_deep_extend( local new_sets = vim.tbl_deep_extend(
"force", {}, M.scheme_options, options "force", {}, M.scheme_options, options
) )
M.scheme_options = new_sets M.scheme_options = new_sets
end end
end end
-- Get the value of secheme options -- Get the value of secheme options
--@param tab table: custom options to be applied to the editor scheme --@param tab table: custom options to be applied to the editor scheme
--@returns settings table: settings adapted to load the scheme --@returns settings table: settings adapted to load the scheme
function M.get_options() function M.get_options()
local settings = {} local settings = {}
local opts = M.scheme_options local opts = M.scheme_options
settings.eof = opts.disable.endOfBuffer settings.eof = opts.disable.endOfBuffer
settings.disable_bg = opts.disable.background and "NONE" settings.disable_bg = opts.disable.background and "NONE"
return settings return settings
end end
return M return M

View File

@ -14,32 +14,32 @@ local g = vim.g
--@parma pos number: a position to search in the table of variants --@parma pos number: a position to search in the table of variants
--@return position number: a valid position for setting a variant from the variant table --@return position number: a valid position for setting a variant from the variant table
local function change_variant(v_tab, pos) local function change_variant(v_tab, pos)
if next(v_tab) == nil then return end if next(v_tab) == nil then return end
return table.getn(v_tab) > pos and pos + 1 or 1 return #v_tab > pos and pos + 1 or 1
end end
---Set a especific variant ---Set a especific variant
--@param scheme string: name of the variant to be set --@param scheme string: name of the variant to be set
function M.set_variant(scheme) function M.set_variant(scheme)
local variant = scheme or "" local variant = scheme or ""
utils.setup_scheme { variant = variant } utils.setup_scheme { variant = variant }
end end
--- Sets a variant in accordance with a valid position in the variants table --- Sets a variant in accordance with a valid position in the variants table
--@param position number: position to load a variant from the variant table --@param position number: position to load a variant from the variant table
local function load_variant(position) local function load_variant(position)
local variant = variants[position] local variant = variants[position]
g.astronomy_variant_loaded = position g.astronomy_variant_loaded = position
M.set_variant(variant) M.set_variant(variant)
vim.api.nvim_command(string.format("echo \"[astronomy] colorscheme changed to '%s'\"", variant)) vim.api.nvim_command(string.format("echo \"[astronomy] colorscheme changed to '%s'\"", variant))
end end
--- Set a variant by scrolling through the variant table in an orderly fashion --- Set a variant by scrolling through the variant table in an orderly fashion
function M.toggle_variant() function M.toggle_variant()
local position = change_variant( local position = change_variant(
variants, g.astronomy_variant_loaded variants, g.astronomy_variant_loaded
) )
load_variant(position) load_variant(position)
end end
return M return M

View File

@ -12,11 +12,11 @@ local M = {}
-- Setup function to load the colorscheme -- Setup function to load the colorscheme
--@param opts table: custom options to be applied to the editor --@param opts table: custom options to be applied to the editor
function M.setup(opts) function M.setup(opts)
utils.setup_scheme(opts) utils.setup_scheme(opts)
end end
M.toggle_variant = functions.toggle_variant M.toggle_variant = functions.toggle_variant
M.random_variant = functions.random_variant M.random_variant = functions.random_variant
M.set_variant = functions.set_variant M.set_variant = functions.set_variant
return M return M

View File

@ -8,25 +8,30 @@
local M = {} local M = {}
local g = vim.g local g = vim.g
local static = {
coq_checked ="#36704f",
coq_sent ="#4b4b4b",
}
-- Load terminal colors -- Load terminal colors
--@param tab table: scheme colors to apply --@param tab table: scheme colors to apply
local function terminal_colors(tab) local function terminal_colors(tab)
g.terminal_color_0 = tab.black g.terminal_color_0 = tab.black
g.terminal_color_1 = tab.darkred g.terminal_color_1 = tab.darkred
g.terminal_color_2 = tab.darkgreen g.terminal_color_2 = tab.darkgreen
g.terminal_color_3 = tab.orange g.terminal_color_3 = tab.orange
g.terminal_color_4 = tab.darkblue g.terminal_color_4 = tab.darkblue
g.terminal_color_5 = tab.darkmagenta g.terminal_color_5 = tab.darkmagenta
g.terminal_color_6 = tab.darkcyan g.terminal_color_6 = tab.darkcyan
g.terminal_color_7 = tab.grey g.terminal_color_7 = tab.grey
g.terminal_color_8 = tab.darkgrey g.terminal_color_8 = tab.darkgrey
g.terminal_color_9 = tab.red g.terminal_color_9 = tab.red
g.terminal_color_10 = tab.green g.terminal_color_10 = tab.green
g.terminal_color_11 = tab.yellow g.terminal_color_11 = tab.yellow
g.terminal_color_12 = tab.blue g.terminal_color_12 = tab.blue
g.terminal_color_13 = tab.magenta g.terminal_color_13 = tab.magenta
g.terminal_color_14 = tab.cyan g.terminal_color_14 = tab.cyan
g.terminal_color_15 = tab.white g.terminal_color_15 = tab.white
end end
-- load colorscheme elements -- load colorscheme elements
@ -34,177 +39,197 @@ end
--@param settings table: custom options to be applied to the scheme --@param settings table: custom options to be applied to the scheme
--@return colors table: all groups and its respectives colors --@return colors table: all groups and its respectives colors
function M.load_colors(scheme) function M.load_colors(scheme)
-- local opts = config.get_options() -- local opts = config.get_options()
local colors = { local colors = {
--------------------- ---------------------
-- EDITOR COLORS -- -- EDITOR COLORS --
--------------------- ---------------------
Normal = { fg = scheme.foreground, bg = scheme.background, scheme.none }, Normal = { fg = scheme.foreground, bg = scheme.background, scheme.none },
NormalFloat = { fg = scheme.foreground, bg = scheme.background_alt, scheme.none }, NormalFloat = { fg = scheme.foreground, bg = scheme.background_alt, scheme.none },
Terminal = { link = "Normal" }, Terminal = { link = "Normal" },
Visual = { fg = scheme.yellow, bg = scheme.background_alt, scheme.none }, Visual = { fg = scheme.green, bg = scheme.background_alt, scheme.none },
VisualNOS = { link = "Visual" }, VisualNOS = { link = "Visual" },
Cursor = { fg = scheme.background, bg = scheme.foreground, scheme.none }, Cursor = { fg = scheme.background, bg = scheme.foreground, scheme.none },
CursorLine = { fg = scheme.none, bg = scheme.background_alt, scheme.none }, CursorLine = { fg = scheme.none, bg = scheme.background_alt, scheme.none },
CursorColumn = { link = "CursorLine" }, CursorColumn = { link = "CursorLine" },
CursorLineNr = { fg = scheme.orange, bg = scheme.none, scheme.none }, CursorLineNr = { fg = scheme.orange, bg = scheme.none, scheme.none },
LineNr = { fg = scheme.grey, bg = scheme.none, scheme.none }, LineNr = { fg = scheme.grey, bg = scheme.none, scheme.none },
VertSplit = { fg = scheme.grey, bg = scheme.none, scheme.none }, VertSplit = { fg = scheme.grey, bg = scheme.none, scheme.none },
SignColumn = { fg = scheme.yellow, bg = scheme.none, scheme.none }, SignColumn = { fg = scheme.yellow, bg = scheme.none, scheme.none },
Folded = { fg = scheme.orange, bg = scheme.background_alt, scheme.none }, Folded = { fg = scheme.orange, bg = scheme.background_alt, scheme.none },
--------------------- ---------------------
---- STATUSLINE ----- ---- STATUSLINE -----
--------------------- ---------------------
StatusLine = { fg = scheme.none, bg = scheme.background, scheme.none }, StatusLine = { fg = scheme.none, bg = scheme.background, scheme.none },
StatusLineTerm = { fg = scheme.none, bg = scheme.green, scheme.none }, StatusLineTerm = { fg = scheme.none, bg = scheme.green, scheme.none },
StatusLineNF = { fg = scheme.foreground, bg = scheme.background_alt, scheme.none }, StatusLineNF = { fg = scheme.foreground, bg = scheme.background_alt, scheme.none },
StatusLineNC = { fg = scheme.none, bg = scheme.none, scheme.none }, StatusLineNC = { fg = scheme.none, bg = scheme.none, scheme.none },
Top = { fg = scheme.background, bg = scheme.foreground_alt, scheme.none }, Top = { fg = scheme.background, bg = scheme.foreground_alt, scheme.none },
Middle = { fg = scheme.foreground, bg = scheme.background_alt, scheme.none }, Middle = { fg = scheme.foreground, bg = scheme.background_alt, scheme.none },
Bottom = { fg = scheme.darkcyan, bg = scheme.background, scheme.none }, Bottom = { fg = scheme.darkcyan, bg = scheme.background, scheme.none },
NormalMode = { fg = scheme.black, bg = scheme.green, style = "bold" }, NormalMode = { fg = scheme.black, bg = scheme.green, style = "bold" },
VisualMode = { fg = scheme.black, bg = scheme.magenta, style = "bold" }, VisualMode = { fg = scheme.black, bg = scheme.magenta, style = "bold" },
InsertMode = { fg = scheme.black, bg = scheme.cyan, style = "bold" }, InsertMode = { fg = scheme.black, bg = scheme.cyan, style = "bold" },
ReplaceMode = { fg = scheme.black, bg = scheme.orange, style = "bold" }, ReplaceMode = { fg = scheme.black, bg = scheme.orange, style = "bold" },
CommandMode = { fg = scheme.black, bg = scheme.yellow, style = "bold" }, CommandMode = { fg = scheme.black, bg = scheme.yellow, style = "bold" },
--------------------- ---------------------
----- MESSAGES ------ ----- MESSAGES ------
--------------------- ---------------------
Title = { fg = scheme.orange, bg = scheme.none, style = "bold" }, Title = { fg = scheme.orange, bg = scheme.none, style = "bold" },
ErrorMsg = { fg = scheme.yellow, bg = scheme.darkred, style = "bold" }, ErrorMsg = { fg = scheme.yellow, bg = scheme.darkred, style = "bold" },
ModeMsg = { fg = scheme.none, bg = scheme.none, style = "bold" }, ModeMsg = { fg = scheme.none, bg = scheme.none, style = "bold" },
MoreMsg = { fg = scheme.green, bg = scheme.none, style = "bold" }, MoreMsg = { fg = scheme.green, bg = scheme.none, style = "bold" },
WarningMsg = { fg = scheme.red, bg = scheme.none, style = "bold" }, WarningMsg = { fg = scheme.red, bg = scheme.none, style = "bold" },
--------------------- ---------------------
------- MENUS ------- ------- MENUS -------
--------------------- ---------------------
Pmenu = { fg = scheme.foreground, bg = scheme.background_alt, scheme.none }, Pmenu = { fg = scheme.foreground, bg = scheme.background_alt, scheme.none },
PmenuSel = { fg = scheme.background, bg = scheme.darkgreen, style = "bold" }, PmenuSel = { fg = scheme.background, bg = scheme.darkgreen, style = "bold" },
PmenuSbar = { fg = scheme.none, bg = scheme.background_alt, scheme.none }, PmenuSbar = { fg = scheme.none, bg = scheme.background_alt, scheme.none },
PmenuThumb = { link = "PmenuSbar" }, PmenuThumb = { link = "PmenuSbar" },
WildMenu = { link = "PmenuSel" }, WildMenu = { link = "PmenuSel" },
--------------------- ---------------------
------- MENUS ------- ------- MENUS -------
--------------------- ---------------------
Conceal = { fg = scheme.grey, bg = scheme.background_alt, scheme.none }, Conceal = { fg = scheme.grey, bg = scheme.background_alt, scheme.none },
Directory = { fg = scheme.magenta, bg = scheme.none, style = "bold" }, Directory = { fg = scheme.magenta, bg = scheme.none, style = "bold" },
NonText = { fg = scheme.blue, bg = scheme.none, scheme.none }, NonText = { fg = scheme.blue, bg = scheme.none, scheme.none },
EndOfBuffer = { link = "Nontext" }, EndOfBuffer = { link = "Nontext" },
Question = { fg = scheme.green, bg = scheme.none, style = "bold" }, Question = { fg = scheme.green, bg = scheme.none, style = "bold" },
Search = { fg = scheme.background, bg = scheme.grey, scheme.none }, Search = { fg = scheme.background, bg = scheme.grey, scheme.none },
QuickFixLine = { link = "Search" }, QuickFixLine = { link = "Search" },
IncSearch = { fg = scheme.none, bg = scheme.none, style = "reverse" }, IncSearch = { fg = scheme.none, bg = scheme.none, style = "reverse" },
SpecialKey = { fg = scheme.green, bg = scheme.none, scheme.none }, SpecialKey = { fg = scheme.green, bg = scheme.none, scheme.none },
--------------------- ---------------------
---- IDENTFIERS ----- ---- IDENTFIERS -----
--------------------- ---------------------
MatchParen = { fg = scheme.background, bg = scheme.blue, style = "bold" }, MatchParen = { fg = scheme.background, bg = scheme.blue, style = "bold" },
Comment = { fg = scheme.grey, bg = scheme.none, scheme.none }, Comment = { fg = scheme.grey, bg = scheme.none, scheme.none },
Ignore = { link = "Comment" }, Ignore = { link = "Comment" },
Whitespace = { link = "Comment" }, Whitespace = { link = "Comment" },
Constant = { fg = scheme.green, bg = scheme.none, scheme.none }, Constant = { fg = scheme.green, bg = scheme.none, scheme.none },
Boolean = { link = "Constant" }, Boolean = { link = "Constant" },
Character = { link = "Constant" }, Character = { link = "Constant" },
Number = { link = "Constant" }, Number = { link = "Constant" },
Float = { link = "Constant" }, Float = { link = "Constant" },
String = { link = "Constant" }, String = { link = "Constant" },
Error = { link = "ErrorMsg" }, Error = { link = "ErrorMsg" },
Identifier = { fg = scheme.blue, bg = scheme.none, style = "bold" }, Identifier = { fg = scheme.blue, bg = scheme.none, style = "bold" },
Function = { link = "Identifier" }, Function = { link = "Identifier" },
PreProc = { fg = scheme.red, bg = scheme.none, scheme.none }, PreProc = { fg = scheme.red, bg = scheme.none, scheme.none },
Define = { link = "PreProc" }, Define = { link = "PreProc" },
Include = { link = "PreProc" }, Include = { link = "PreProc" },
Macro = { link = "PreProc" }, Macro = { link = "PreProc" },
PreCondit = { link = "PreProc" }, PreCondit = { link = "PreProc" },
Special = { fg = scheme.orange, bg = scheme.none, scheme.none }, Special = { fg = scheme.orange, bg = scheme.none, scheme.none },
SpecialChar = { link = "Special" }, SpecialChar = { link = "Special" },
SpecialComment = { link = "Special" }, SpecialComment = { link = "Special" },
Debug = { link = "Special" }, Debug = { link = "Special" },
Delimiter = { link = "Special" }, Delimiter = { link = "Special" },
Tag = { link = "Special" }, Tag = { link = "Special" },
Statement = { fg = scheme.magenta, bg = scheme.none, scheme.none }, Statement = { fg = scheme.magenta, bg = scheme.none, scheme.none },
Conditional = { link = "Statement" }, Conditional = { link = "Statement" },
Exception = { link = "Statement" }, Exception = { link = "Statement" },
Keyword = { link = "Statement" }, Keyword = { link = "Statement" },
Label = { link = "Statement" }, Label = { link = "Statement" },
Operator = { link = "Statement" }, Operator = { link = "Statement" },
Repeat = { link = "Statement" }, Repeat = { link = "Statement" },
Todo = { fg = scheme.black, bg = scheme.yellow, style = "bold" }, Todo = { fg = scheme.black, bg = scheme.yellow, style = "bold" },
Type = { fg = scheme.yellow, bg = scheme.none, style = "bold" }, Type = { fg = scheme.yellow, bg = scheme.none, style = "bold" },
StorageClass = { link = "Type" }, StorageClass = { link = "Type" },
Structure = { link = "Type" }, Structure = { link = "Type" },
Typedef = { link = "Type" }, Typedef = { link = "Type" },
Underlined = { fg = scheme.darkblue, bg = scheme.none, style = "underline" }, Underlined = { fg = scheme.darkblue, bg = scheme.none, style = "underline" },
--------------------- ---------------------
-- LANGUAGE COLORS -- -- LANGUAGE COLORS --
--------------------- ---------------------
--------- ---------
-- GIT -- -- GIT --
--------- ---------
signifySignAdd = { fg = scheme.green, bg = scheme.none, scheme.none }, signifySignAdd = { fg = scheme.green, bg = scheme.none, scheme.none },
signifySignChange = { fg = scheme.yellow, bg = scheme.none, scheme.none }, signifySignChange = { fg = scheme.yellow, bg = scheme.none, scheme.none },
signifySignDelete = { fg = scheme.red, bg = scheme.none, scheme.none }, signifySignDelete = { fg = scheme.red, bg = scheme.none, scheme.none },
gitcommitComment = { fg = scheme.grey, bg = scheme.none, scheme.none }, gitcommitComment = { fg = scheme.grey, bg = scheme.none, scheme.none },
gitcommitDiscardedType = { fg = scheme.red, bg = scheme.none, scheme.none }, gitcommitDiscardedType = { fg = scheme.red, bg = scheme.none, scheme.none },
gitcommitSelectedType = { fg = scheme.green, bg = scheme.none, scheme.none }, gitcommitSelectedType = { fg = scheme.green, bg = scheme.none, scheme.none },
gitcommitHeader = { fg = scheme.none, bg = scheme.none, scheme.none }, gitcommitHeader = { fg = scheme.none, bg = scheme.none, scheme.none },
gitcommitUntrackedFile = { fg = scheme.cyan, bg = scheme.none, scheme.none }, gitcommitUntrackedFile = { fg = scheme.cyan, bg = scheme.none, scheme.none },
gitcommitDiscardedFile = { fg = scheme.red, bg = scheme.none, scheme.none }, gitcommitDiscardedFile = { fg = scheme.red, bg = scheme.none, scheme.none },
gitcommitSelectedFile = { fg = scheme.green, bg = scheme.none, scheme.none }, gitcommitSelectedFile = { fg = scheme.green, bg = scheme.none, scheme.none },
gitcommitUnmergedFile = { fg = scheme.yellow, bg = scheme.none, scheme.none }, gitcommitUnmergedFile = { fg = scheme.yellow, bg = scheme.none, scheme.none },
gitcommitUnmerged = { fg = scheme.green, bg = scheme.none, scheme.none }, gitcommitUnmerged = { fg = scheme.green, bg = scheme.none, scheme.none },
gitcommitOnBranch = { fg = scheme.none, bg = scheme.none, scheme.none }, gitcommitOnBranch = { fg = scheme.none, bg = scheme.none, scheme.none },
gitcommitBranch = { fg = scheme.magenta, bg = scheme.none, scheme.none }, gitcommitBranch = { fg = scheme.magenta, bg = scheme.none, scheme.none },
---------- ----------
-- diff -- -- diff --
---------- ----------
diffAdded = { fg = scheme.green, bg = scheme.none, scheme.none }, diffAdded = { fg = scheme.green, bg = scheme.none, scheme.none },
diffFile = { fg = scheme.orange, bg = scheme.none, scheme.none }, diffFile = { fg = scheme.orange, bg = scheme.none, scheme.none },
diffNewFile = { fg = scheme.yellow, bg = scheme.none, scheme.none }, diffNewFile = { fg = scheme.yellow, bg = scheme.none, scheme.none },
diffChanged = { fg = scheme.cyan, bg = scheme.none, scheme.none }, diffChanged = { fg = scheme.cyan, bg = scheme.none, scheme.none },
diffRemoved = { fg = scheme.red, bg = scheme.none, scheme.none }, diffRemoved = { fg = scheme.red, bg = scheme.none, scheme.none },
diffLine = { fg = scheme.blue, bg = scheme.none, scheme.none }, diffLine = { fg = scheme.blue, bg = scheme.none, scheme.none },
---------------- ----------------
-- LSP COLORS -- -- LSP COLORS --
---------------- ----------------
DiagnosticVirtualTextWarn = { fg = scheme.orange, bg = scheme.none, scheme.none }, DiagnosticVirtualTextWarn = { fg = scheme.orange, bg = scheme.none, scheme.none },
DiagnosticUnderlineWarn = { fg = scheme.orange, bg = scheme.none, style = "underline" }, DiagnosticUnderlineWarn = { fg = scheme.orange, bg = scheme.none, style = "underline" },
DiagnosticFloatingWarn = { link = "DiagnosticVirtualTextWarn" }, DiagnosticFloatingWarn = { link = "DiagnosticVirtualTextWarn" },
DiagnosticSignWarn = { link = "DiagnosticVirtualTextWarn" }, DiagnosticSignWarn = { link = "DiagnosticVirtualTextWarn" },
DiagnosticVirtualTextError = { fg = scheme.red, bg = scheme.none, scheme.none }, DiagnosticVirtualTextError = { fg = scheme.red, bg = scheme.none, scheme.none },
DiagnosticUnderlineError = { fg = scheme.red, bg = scheme.none, style = "underline" }, DiagnosticUnderlineError = { fg = scheme.red, bg = scheme.none, style = "underline" },
DiagnosticFloatingError = { link = "DiagnosticVirtualTextError" }, DiagnosticFloatingError = { link = "DiagnosticVirtualTextError" },
DiagnosticSignError = { link = "DiagnosticVirtualTextError" }, DiagnosticSignError = { link = "DiagnosticVirtualTextError" },
DiagnosticVirtualTextInfo = { fg = scheme.blue, bg = scheme.none, scheme.none }, DiagnosticVirtualTextInfo = { fg = scheme.blue, bg = scheme.none, scheme.none },
DiagnosticUnderlineInfo = { fg = scheme.blue, bg = scheme.none, style = "underline" }, DiagnosticUnderlineInfo = { fg = scheme.blue, bg = scheme.none, style = "underline" },
DiagnosticFloatingInfo = { link = "DiagnosticVirtualTextInfo" }, DiagnosticFloatingInfo = { link = "DiagnosticVirtualTextInfo" },
DiagnosticSignInfo = { link = "DiagnosticVirtualTextInfo" }, DiagnosticSignInfo = { link = "DiagnosticVirtualTextInfo" },
DiagnosticVirtualTextHint = { fg = scheme.yellow, bg = scheme.none, scheme.none }, DiagnosticVirtualTextHint = { fg = scheme.yellow, bg = scheme.none, scheme.none },
DiagnosticUnderlineHint = { fg = scheme.yellow, bg = scheme.none, style = "underline" }, DiagnosticUnderlineHint = { fg = scheme.yellow, bg = scheme.none, style = "underline" },
DiagnosticFloatingHint = { link = "DiagnosticVirtualTextHint" }, DiagnosticFloatingHint = { link = "DiagnosticVirtualTextHint" },
DiagnosticSignHint = { link = "DiagnosticVirtualTextHint" }, DiagnosticSignHint = { link = "DiagnosticVirtualTextHint" },
---------------- --------------------
-- COQ COLORS -- -- LUASNIP COLORS --
---------------- --------------------
CoqtailChecked = { fg = scheme.none, bg = scheme.darkgreen, scheme.none }, LuaSnipInactive = { link = "Comment" },
CoqtailSent = { fg = scheme.none, bg = scheme.darkgrey, scheme.none }, LuaSnipChoice = { fg = scheme.yellow, bg = scheme.none, scheme.none },
} LuaSnipFunction = { fg = scheme.magenta, bg = scheme.none, scheme.none },
LuaSnipInsert = { fg = scheme.blue, bg = scheme.none, scheme.none },
terminal_colors(scheme) ----------------
return colors -- CMP COLORS --
----------------
CmpItemKindVariable = { fg = scheme.none, bg = scheme.none, scheme.none },
CmpItemKindClass = { fg = scheme.yellow, bg = scheme.none, scheme.none },
CmpItemKindInterface = { link = "CmpItemKindClass" },
CmpItemKindModule = { link = "CmpItemKindClass" },
CmpItemKindText = { fg = scheme.green, bg = scheme.none, scheme.none },
CmpItemKindKeyword = { fg = scheme.orange, bg = scheme.none, scheme.none },
CmpItemKindFunction = { fg = scheme.blue, bg = scheme.none, scheme.none },
CmpItemKindMethod = { link = "CmpItemKindFunction" },
----------------
-- COQ COLORS --
----------------
CoqtailChecked = { fg = scheme.none, bg = static.coq_checked, scheme.none },
CoqtailSent = { fg = scheme.none, bg = static.coq_sent, scheme.none },
}
terminal_colors(scheme)
return colors
end end
return M return M

View File

@ -15,56 +15,55 @@ local M = {}
--@param group string: group name --@param group string: group name
--@param cols string: color name to be applied to the groups --@param cols string: color name to be applied to the groups
local function set_highlights(group, cols) local function set_highlights(group, cols)
api.nvim_command(string.format('highlight %s gui=%s guifg=%s guibg=%s guisp=%s', api.nvim_command(string.format('highlight %s gui=%s guifg=%s guibg=%s guisp=%s',
group, group,
cols.style or "NONE", cols.style or "NONE",
cols.fg or "NONE", cols.fg or "NONE",
cols.bg or "NONE", cols.bg or "NONE",
cols.sp or "NONE" cols.sp or "NONE"
)) ))
if cols.link then if cols.link then
api.nvim_command(string.format("highlight! link %s %s", group, cols.link)) api.nvim_command(string.format("highlight! link %s %s", group, cols.link))
end end
end end
-- Load colorscheme -- Load colorscheme
--@param scheme table: editor elements with its colors --@param scheme table: editor elements with its colors
--@param custom_tab table: custom color table --@param custom_tab table: custom color table
local function load_colorscheme(scheme, custom_tab) local function load_colorscheme(scheme, custom_tab)
local color_table = scheme or {} local color_table = scheme or {}
local custom_colors = custom_tab or {} local custom_colors = custom_tab or {}
-- reset the highlighting -- reset the highlighting
if vim.fn.exists("sintax_on") then api.nvim_command("syntax reset") end if vim.fn.exists("sintax_on") then api.nvim_command("syntax reset") end
vim.opt.background = "dark" vim.opt.background = "dark"
vim.g.colors_name = "astronomy" vim.g.colors_name = "astronomy"
vim.g.astronomy = 1 vim.g.astronomy = 1
vim.opt.termguicolors = true vim.opt.termguicolors = true
if type(custom_colors) == "table" then if type(custom_colors) == "table" then
if next(custom_colors) ~= nil then if next(custom_colors) ~= nil then
color_table = vim.tbl_deep_extend("force", {}, color_table, custom_colors) color_table = vim.tbl_deep_extend("force", {}, color_table, custom_colors)
end
end
--Load editor colors
for grp, col in pairs(color_table) do
set_highlights(grp, col)
end end
end
--Load editor colors
for grp, col in pairs(color_table) do
set_highlights(grp, col)
end
end end
-- Set and load the color scheme -- Set and load the color scheme
--@param opts table: custom options to be applied to the editor --@param opts table: custom options to be applied to the editor
function M.setup_scheme(opts) function M.setup_scheme(opts)
config.set_options(opts) config.set_options(opts)
local sch_opts = config.scheme_options local sch_opts = config.scheme_options
local scheme = colors.set_scheme(sch_opts.variant) local scheme = colors.set_scheme(sch_opts.variant)
local colorscheme = theme.load_colors(scheme) local colorscheme = theme.load_colors(scheme)
load_colorscheme(colorscheme, sch_opts.custom_colors) load_colorscheme(colorscheme, sch_opts.custom_colors)
end end
return M return M