Skip to content

Commit

Permalink
feat(extras): base16 theme
Browse files Browse the repository at this point in the history
starting point for #133
  • Loading branch information
scottmckendry committed Sep 12, 2024
1 parent 10d79f3 commit 5be7d02
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions lua/cyberdream/extra/base16.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
local colors = require("cyberdream.colors")
local util = require("cyberdream.util")

-- remove the # from the hex color
local function fomat_colors(unformatted)
local formatted = {}
for k, v in pairs(unformatted) do
formatted[k] = string.sub(v, 2)
end
return formatted
end

local M = {}

--- Generate cyberdream theme for base16.
--- @param variant string: Variation of the colorscheme to use.
function M.generate(variant)
local formatted_colors = fomat_colors(colors[variant])
local template = [==[
scheme: "Cyberdream"
author: "Scott McKendry"
base00: "${bg}"
base01: "${bgAlt}"
base02: "${bgHighlight}"
base03: "${grey}"
base04: "${grey}"
base05: "${fg}"
base06: "${bg}"
base07: "${fg}"
base08: "${red}"
base09: "${orange}"
base0A: "${yellow}"
base0B: "${green}"
base0C: "${cyan}"
base0D: "${blue}"
base0E: "${purple}"
base0F: "${magenta}"
]==]
return util.parse_extra_template(template, formatted_colors)
end

return M
1 change: 1 addition & 0 deletions lua/cyberdream/extra/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ M.variants = {

M.extras = {
alacritty = { extension = "toml", name = "alacritty" },
base16 = { extension = "yaml", name = "base16" },
fish = { extension = "theme", name = "fish" },
gitui = { extension = "ron", name = "gitui" },
helix = { extension = "toml", name = "helix" },
Expand Down

0 comments on commit 5be7d02

Please sign in to comment.