Skip to content

Commit

Permalink
feat: github dark_default colorscheme added projekt0n#24 projekt0n#16
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Sep 13, 2021
1 parent 1c50927 commit 235247a
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 144 deletions.
151 changes: 76 additions & 75 deletions lua/github-theme/colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,98 +17,99 @@ function M.setup(config)
local colors = {
none = "NONE",

-- Core Colors
fg_dark = themes({dark = "#666666", dimmed = "#636e7b", light = "#666666"}),
term_fg = themes({dark = "#d1d5da", dimmed = "#768390", light = "#586069"}),

-- Terminal Colors
fg_dark = themes({dark = "#666666", dimmed = "#636e7b", light = "#666666", dark_default = "#4d5566"}),
term_fg = themes({dark = "#d1d5da", dimmed = "#768390", light = "#586069", dark_default = "#b3b1ad"}),
orange = "#d18616",
black = themes({dark = "#24292e", dimmed = "#22272e", light = "#697179"}),
brightBlack = themes({dark = "#666666", dimmed = "#636e7b", light = "#666666"}),
white = themes({dark = "#b1bac4", dimmed = "#909dab", light = "#e1e4e8"}),
brightWhite = themes({dark = "#e5e5e5", dimmed = "#cdd9e5", light = "#a5a5a5"}),
red = themes({dark = "#f14c4c", dimmed = "#ff938a", light = "#d03d3d"}),
brightRed = themes({dark = "#f14c4c", dimmed = "#ff938a", light = "#cd3131"}),
green = themes({dark = "#23d18b", dimmed = "#6bc46d", light = "#14ce14"}),
brightGreen = themes({dark = "#23d18b", dimmed = "#6bc46d", light = "#14ce14"}),
yellow = themes({dark = "#e2e210", dimmed = "#c69026", light = "#949800"}),
brightYellow = themes({dark = "#f5f543", dimmed = "#daaa3f", light = "#b5ba00"}),
blue = themes({dark = "#3b8eea", dimmed = "#6cb6ff", light = "#0451a5"}),
brightBlue = themes({dark = "#3b8eea", dimmed = "#6cb6ff", light = "#0451a5"}),
magenta = themes({dark = "#bc3fbc", dimmed = "#b083f0", light = "#bc05bc"}),
brightMagenta = themes({dark = "#d670d6", dimmed = "#dcbdfb", light = "#bc05bc"}),
cyan = themes({dark = "#29b7da", dimmed = "#56d4dd", light = "#0598bc"}),
brightCyan = themes({dark = "#29b8db", dimmed = "#56d4dd", light = "#0598bc"}),

bg = themes({dark = "#24292e", dimmed = "#22272e", light = "#ffffff"}),
bg2 = themes({dark = "#1f2428", dimmed = "#1e2228", light = "#f6f8fa"}),
bg_visual = themes({dark = "#444c56", dimmed = "#444c56", light = "#e1e4e8"}),
bg_visual_selection = themes({dark = "#284566", dimmed = "#264466", light = "#dbe9f9"}),
bg_highlight = themes({dark = "#2c313a", dimmed = "#2d333b", light = "#f6f8fa"}),

border = themes({dark = "#c9d1d9", dimmed = "#444c56", light = "#044289"}),

fg = themes({dark = "#c9d1d9", dimmed = "#adbac7", light = "#24292e"}),
fg_light = themes({dark = "#d1d5da", dimmed = "#adbac7", light = "#586069"}),
fg_gutter = themes({dark = "#e1e4e8", dimmed = "#768390", light = "#babbbd"}),

cursor = themes({dark = "#c8e1ff", dimmed = "#6cb6ff", light = "#044289"}),

line_nr = themes({dark = "#444d56", dimmed = "#768390", light = "#babbbd"}),
cursor_line_nr = themes({dark = "#e1e4e8", dimmed = "#adbac7", light = "#24292e"}),

bg_search = themes({dark = "#404030", dimmed = "#3f3e30", light = "#fff2be"}),

error = themes({dark = "#f97583", dimmed = "#e5534b", light = "#cb2431"}),
warning = themes({dark = "#cca700", dimmed = "#cca700", light = "#bf8803"}),
black = themes({dark = "#24292e", dimmed = "#22272e", light = "#697179", dark_default = "#484f58"}),
brightBlack = themes({dark = "#666666", dimmed = "#636e7b", light = "#666666", dark_default = "#6e7681"}),
white = themes({dark = "#b1bac4", dimmed = "#909dab", light = "#e1e4e8", dark_default = "#b1bac4"}),
brightWhite = themes({dark = "#e5e5e5", dimmed = "#cdd9e5", light = "#a5a5a5", dark_default = "#f0f6fc"}),
red = themes({dark = "#f14c4c", dimmed = "#ff938a", light = "#d03d3d", dark_default = "#ff7b72"}),
brightRed = themes({dark = "#f14c4c", dimmed = "#ff938a", light = "#cd3131", dark_default = "#ffa198"}),
green = themes({dark = "#23d18b", dimmed = "#6bc46d", light = "#14ce14", dark_default = "#3fb950"}),
brightGreen = themes({dark = "#23d18b", dimmed = "#6bc46d", light = "#14ce14", dark_default = "#56d364"}),
yellow = themes({dark = "#e2e210", dimmed = "#c69026", light = "#949800", dark_default = "#d29922"}),
brightYellow = themes({dark = "#f5f543", dimmed = "#daaa3f", light = "#b5ba00", dark_default = "#e3b341"}),
blue = themes({dark = "#3b8eea", dimmed = "#6cb6ff", light = "#0451a5", dark_default = "#58a6ff"}),
brightBlue = themes({dark = "#3b8eea", dimmed = "#6cb6ff", light = "#0451a5", dark_default = "#79c0ff"}),
magenta = themes({dark = "#bc3fbc", dimmed = "#b083f0", light = "#bc05bc", dark_default = "#bc8cff"}),
brightMagenta = themes({dark = "#d670d6", dimmed = "#dcbdfb", light = "#bc05bc", dark_default = "#d2a8ff"}),
cyan = themes({dark = "#29b7da", dimmed = "#56d4dd", light = "#0598bc", dark_default = "#39c5cf"}),
brightCyan = themes({dark = "#29b8db", dimmed = "#56d4dd", light = "#0598bc", dark_default = "#56d4dd"}),

-- basic
bg = themes({dark = "#24292e", dimmed = "#22272e", light = "#ffffff", dark_default = "#0d1117"}),
bg2 = themes({dark = "#1f2428", dimmed = "#1e2228", light = "#f6f8fa", dark_default = "#090c10"}),
bg_visual = themes({dark = "#444c56", dimmed = "#444c56", light = "#e1e4e8", dark_default = "#b3b1ad"}),
bg_visual_selection = themes({dark = "#284566", dimmed = "#264466", light = "#dbe9f9", dark_default = "#163356"}),
bg_highlight = themes({dark = "#2c313a", dimmed = "#2d333b", light = "#f6f8fa", dark_default = "#161b22"}),

border = themes({dark = "#c9d1d9", dimmed = "#444c56", light = "#044289", dark_default = "#b3b1ad"}),

fg = themes({dark = "#c9d1d9", dimmed = "#adbac7", light = "#24292e", dark_default = "#c9d1d9"}),
fg_light = themes({dark = "#d1d5da", dimmed = "#adbac7", light = "#586069", dark_default = "#b3b1ad"}),
fg_gutter = themes({dark = "#e1e4e8", dimmed = "#768390", light = "#babbbd", dark_default = "#c5c5c5"}),

-- cursor
cursor = themes({dark = "#c8e1ff", dimmed = "#6cb6ff", light = "#044289", dark_default = "#73b7f2"}),

line_nr = themes({dark = "#444d56", dimmed = "#768390", light = "#babbbd", dark_default = "#8b949e"}),
cursor_line_nr = themes({dark = "#e1e4e8", dimmed = "#adbac7", light = "#24292e", dark_default = "#c9d1d9"}),

bg_search = themes({dark = "#404030", dimmed = "#3f3e30", light = "#fff2be", dark_default = "#2c2b1c"}),

-- lsp
error = themes({dark = "#f97583", dimmed = "#e5534b", light = "#cb2431", dark_default = "#f85149"}),
warning = themes({dark = "#cca700", dimmed = "#cca700", light = "#bf8803", dark_default = "#f0883e"}),
info = "#75beff",
hint = themes({dark = "#eeeeb3", dimmed = "#eeeeb3", light = "#6c6c6c"}),
hint = themes({dark = "#eeeeb3", dimmed = "#eeeeb3", light = "#6c6c6c", dark_default = "#eeeeb3"}),

lsp = {
referenceText = themes({dark = "#265459", dimmed = "#28575d", light = "#c6eed2"})
},
lsp = {referenceText = themes({dark = "#265459", dimmed = "#28575d", light = "#c6eed2", dark_default = "#164449"})},

syntax = {
comment = themes({dark = "#6a737d", dimmed = "#768390", light = "#6a737d"}),
constant = themes({dark = "#79b8ff", dimmed = "#6cb6ff", light = "#005cc5"}),
string = themes({dark = "#9ecbff", dimmed = "#96d0ff", light = "#032f62"}),
variable = themes({dark = "#79b8ff", dimmed = "#6cb6ff", light = "#005cc5"}),
keyword = themes({dark = "#f97583", dimmed = "#f47067", light = "#d73a49"}),
func = themes({dark = "#b392f0", dimmed = "#dcbdfb", light = "#6f42c1"}),
func_param = themes({dark = "#e1e4e8", dimmed = "#adbac7", light = "#24292e"}),
matchParenBG = themes({dark = "#25686c", dimmed = "#266a70", light = "#c6eed2"}),
tag = themes({dark = "#85e89d", dimmed = "#8ddb8c", light = "#22863a"}),
htmlArg = themes({dark = "#fdaeb7", dimmed = "#ff938a", light = "#b31d28"}),
param = themes({dark = "#ffab70", dimmed = "#f69d50", light = "#e36209"}),
jsonLabel = themes({dark = "#79b8ff", dimmed = "#6cb6ff", light = "#005cc5"})
comment = themes({dark = "#6a737d", dimmed = "#768390", light = "#6a737d", dark_default = "#8b949e"}),
constant = themes({dark = "#79b8ff", dimmed = "#6cb6ff", light = "#005cc5", dark_default = "#79c0ff"}),
string = themes({dark = "#9ecbff", dimmed = "#96d0ff", light = "#032f62", dark_default = "#A5D6FF"}),
variable = themes({dark = "#79b8ff", dimmed = "#6cb6ff", light = "#005cc5", dark_default = "#FFA657"}),
keyword = themes({dark = "#f97583", dimmed = "#f47067", light = "#d73a49", dark_default = "#ff7b72"}),
func = themes({dark = "#b392f0", dimmed = "#dcbdfb", light = "#6f42c1", dark_default = "#d2a8ff"}),
func_param = themes({dark = "#e1e4e8", dimmed = "#adbac7", light = "#24292e", dark_default = "#c9d1d9"}),
match_paren_bg = themes({dark = "#25686c", dimmed = "#266a70", light = "#c6eed2", dark_default = "#105357"}),
tag = themes({dark = "#85e89d", dimmed = "#8ddb8c", light = "#22863a", dark_default = "#7ee787"}),
html_arg = themes({dark = "#fdaeb7", dimmed = "#ff938a", light = "#b31d28", dark_default = "#ff7b72"}),
param = themes({dark = "#ffab70", dimmed = "#f69d50", light = "#e36209", dark_default = "#ffa657"}),
json_label = themes({dark = "#79b8ff", dimmed = "#6cb6ff", light = "#005cc5", dark_default = "#79c0ff"})
},

-- auto complication
pmenu = {
select = themes({dark = "#044289", dimmed = "#373e47", light = "#cce5ff"}),
bg = themes({dark = "#1f2428", dimmed = "#323941", light = "#f6f8fa"}),
sbar = themes({dark = "#32383e", dimmed = "#363b44", light = "#f0f1f3"})
select = themes({dark = "#044289", dimmed = "#373e47", light = "#cce5ff", dark_default = "#39414a"}),
bg = themes({dark = "#1f2428", dimmed = "#323941", light = "#f6f8fa", dark_default = "#1c2128"}),
sbar = themes({dark = "#32383e", dimmed = "#363b44", light = "#f0f1f3", dark_default = "#31373d"})
},

git = {
change = themes({dark = "#79b8ff", dimmed = "#daaa3f", light = "#005cc8"}),
add = themes({dark = "#34d058", dimmed = "#6bc46d", light = "#28a745"}),
delete = themes({dark = "#ea4a5a", dimmed = "#b34642", light = "#d73a49"}),
conflict = themes({dark = "#ffab70", dimmed = "#daaa3f", light = "#e36209"}),
ignore = themes({dark = "#6a737d", dimmed = "#545d68", light = "#959da5"})
change = themes({dark = "#79b8ff", dimmed = "#daaa3f", light = "#005cc8", dark_default = "#ac8934"}),
add = themes({dark = "#34d058", dimmed = "#6bc46d", light = "#28a745", dark_default = "#56d364"}),
delete = themes({dark = "#ea4a5a", dimmed = "#b34642", light = "#d73a49", dark_default = "#f85149"}),
conflict = themes({dark = "#ffab70", dimmed = "#daaa3f", light = "#e36209", dark_default = "#e3b341"}),
ignore = themes({dark = "#6a737d", dimmed = "#545d68", light = "#959da5", dark_default = "#484f58"})
},

diff = {
add = themes({dark = "#244032", dimmed = "#293d34", light = "#e4f9e9"}),
add_fg = themes({dark = "#56d364", dimmed = "#6bc46d", light = "#22863a"}),
change = themes({dark = "#341a00", dimmed = "#452700", light = "#fff5b1"}),
change_fg = themes({dark = "#e3b341", dimmed = "#daaa3f", light = "#b08800"}),
delete = themes({dark = "#462c32", dimmed = "#432b30", light = "#fae5e7"}),
delete_fg = themes({dark = "#f85149", dimmed = "#e5534b", light = "#cb2431"})
add = themes({dark = "#244032", dimmed = "#293d34", light = "#e4f9e9", dark_default = "#c9d1d9"}),
add_fg = themes({dark = "#56d364", dimmed = "#6bc46d", light = "#22863a", dark_default = "#1f4b2d"}),
change = themes({dark = "#341a00", dimmed = "#452700", light = "#fff5b1", dark_default = "#9e6a03"}),
change_fg = themes({dark = "#e3b341", dimmed = "#daaa3f", light = "#b08800", dark_default = "#e3b341"}),
delete = themes({dark = "#462c32", dimmed = "#432b30", light = "#fae5e7", dark_default = "#b3b1ad"}),
delete_fg = themes({dark = "#f85149", dimmed = "#e5534b", light = "#cb2431", dark_default = "#f85149"})
},

gitSigns = {
change = themes({dark = "#2188ff", dimmed = "#966600", light = "#2188ff"}),
add = themes({dark = "#28a745", dimmed = "#2b6a30", light = "#28a745"}),
delete = themes({dark = "#ea4a5a", dimmed = "#ad2e2c", light = "#d73a49"})
change = themes({dark = "#2188ff", dimmed = "#966600", light = "#2188ff", dark_default = "#9e6a03"}),
add = themes({dark = "#28a745", dimmed = "#2b6a30", light = "#28a745", dark_default = "#196c2e"}),
delete = themes({dark = "#ea4a5a", dimmed = "#ad2e2c", light = "#d73a49", dark_default = "#b62324"})
},

devIcons = {
Expand Down
4 changes: 1 addition & 3 deletions lua/github-theme/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ local function applyConfiguration(userConfig)
if value ~= nil then
if config[key] ~= nil then
config[key] = value
if key == "themeStyle" and value ~= vim.g.github_theme_style then
vim.g.github_theme_style = value
end
if key == "themeStyle" and value ~= vim.g.github_theme_style then vim.g.github_theme_style = value end
else
error("projekt0n/github-nvim-theme: Option " .. key .. " does not exist") -- luacheck: ignore
end
Expand Down
4 changes: 1 addition & 3 deletions lua/github-theme/extra/alacritty.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ function M.alacritty(config)
local colors = require("github-theme.colors").setup(config)

local alacrittyColors = {}
for k, v in pairs(colors) do
if type(v) == "string" then alacrittyColors[k] = v:gsub("^#", "0x") end
end
for k, v in pairs(colors) do if type(v) == "string" then alacrittyColors[k] = v:gsub("^#", "0x") end end

local alacritty = util.template([[
# github Alacritty Colors
Expand Down
9 changes: 2 additions & 7 deletions lua/github-theme/extra/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ local function write(str, fileName)
file:close()
end

local extras = {
kitty = "conf",
alacritty = "yml",
iterm = "itermcolors",
konsole = "colorscheme"
}
for _, style in ipairs({"dark", "dimmed", "light"}) do
local extras = {kitty = "conf", alacritty = "yml", iterm = "itermcolors", konsole = "colorscheme"}
for _, style in ipairs({"dark", "dimmed", "light", "dark_default"}) do
configModule.themeStyle = style
for extra, ext in pairs(extras) do
local plugin = require("github-theme.extra." .. extra)
Expand Down
7 changes: 3 additions & 4 deletions lua/github-theme/extra/iterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ local M = {}

local rgb = function(hex)
local _, redColor, greenColor, blueColor = hex:match("(.)(..)(..)(..)")
redColor, greenColor, blueColor =
string.format("%0.16f", (tonumber(redColor, 16) / 255)),
string.format("%0.16f", (tonumber(greenColor, 16) / 255)),
string.format("%0.16f", (tonumber(blueColor, 16) / 255))
redColor, greenColor, blueColor = string.format("%0.16f", (tonumber(redColor, 16) / 255)),
string.format("%0.16f", (tonumber(greenColor, 16) / 255)),
string.format("%0.16f", (tonumber(blueColor, 16) / 255))
return {r = redColor, g = greenColor, b = blueColor}
end

Expand Down
7 changes: 2 additions & 5 deletions lua/github-theme/extra/konsole.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ local M = {}
function M.Hex2rgb(hex)
hex = hex:gsub("#", "")
return table.concat({
tonumber("0x" .. hex:sub(1, 2)), tonumber("0x" .. hex:sub(3, 4)),
tonumber("0x" .. hex:sub(5, 6))
tonumber("0x" .. hex:sub(1, 2)), tonumber("0x" .. hex:sub(3, 4)), tonumber("0x" .. hex:sub(5, 6))
}, ",")
end

Expand All @@ -17,9 +16,7 @@ function M.konsole(config)
local colors = require("github-theme.colors").setup(config)

local konsoleColors = {}
for k, v in pairs(colors) do
if type(v) == "string" then konsoleColors[k] = M.Hex2rgb(v) end
end
for k, v in pairs(colors) do if type(v) == "string" then konsoleColors[k] = M.Hex2rgb(v) end end

local description = "Github " .. config.themeStyle:lower():gsub("^%l", string.upper)

Expand Down
13 changes: 4 additions & 9 deletions lua/github-theme/hsluv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,13 @@ end

hsluv.xyz_to_rgb = function(tuple)
return {
hsluv.from_linear(hsluv.dot_product(hsluv.m[1], tuple)),
hsluv.from_linear(hsluv.dot_product(hsluv.m[2], tuple)),
hsluv.from_linear(hsluv.dot_product(hsluv.m[1], tuple)), hsluv.from_linear(hsluv.dot_product(hsluv.m[2], tuple)),
hsluv.from_linear(hsluv.dot_product(hsluv.m[3], tuple))
}
end

hsluv.rgb_to_xyz = function(tuple)
local rgbl = {
hsluv.to_linear(tuple[1]), hsluv.to_linear(tuple[2]), hsluv.to_linear(tuple[3])
}
local rgbl = {hsluv.to_linear(tuple[1]), hsluv.to_linear(tuple[2]), hsluv.to_linear(tuple[3])}
return {
hsluv.dot_product(hsluv.minv[1], rgbl), hsluv.dot_product(hsluv.minv[2], rgbl),
hsluv.dot_product(hsluv.minv[3], rgbl)
Expand Down Expand Up @@ -292,13 +289,11 @@ hsluv.hex_to_hpluv = function(s)
end

hsluv.m = {
{3.240969941904521, -1.537383177570093, -0.498610760293},
{-0.96924363628087, 1.87596750150772, 0.041555057407175},
{3.240969941904521, -1.537383177570093, -0.498610760293}, {-0.96924363628087, 1.87596750150772, 0.041555057407175},
{0.055630079696993, -0.20397695888897, 1.056971514242878}
}
hsluv.minv = {
{0.41239079926595, 0.35758433938387, 0.18048078840183},
{0.21263900587151, 0.71516867876775, 0.072192315360733},
{0.41239079926595, 0.35758433938387, 0.18048078840183}, {0.21263900587151, 0.71516867876775, 0.072192315360733},
{0.019330818715591, 0.11919477979462, 0.95053215224966}
}
hsluv.refY = 1.0
Expand Down
12 changes: 5 additions & 7 deletions lua/github-theme/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function M.setup(config)
Substitute = {bg = c.red, fg = c.black}, -- |:substitute| replacement text highlighting
LineNr = {fg = c.line_nr}, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
CursorLineNr = {fg = c.cursor_line_nr}, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
MatchParen = {bg = c.syntax.matchParenBG, fg = c.fg}, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
MatchParen = {bg = c.syntax.match_paren_bg, fg = c.fg}, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
ModeMsg = {fg = c.fg, style = "bold"}, -- 'showmode' message (e.g., "-- INSERT -- ")
MsgArea = {fg = c.fg, style = config.msgAreaStyle}, -- Area for messages and cmdline
-- MsgSeparator= { }, -- Separator for scrolled messages, `msgsep` flag of 'display'
Expand Down Expand Up @@ -226,7 +226,7 @@ function M.setup(config)
TSVariable = {fg = c.syntax.variable, style = config.variableStyle}, -- Any variable name that does not have another highlight.
TSVariableBuiltin = {fg = c.syntax.variable}, -- Variable names that are defined by the languages, like `this` or `self`.
TSTag = {fg = c.syntax.tag}, -- Tags like html tag names.
-- TSTagDelimiter = { }; -- Tag delimiter like `<` `>` `/`
TSTagDelimiter = {fg = c.fg}, -- Tag delimiter like `<` `>` `/`
-- TSText = { }; -- For strings considered text in a markup language.
TSTextReference = {fg = c.red}, -- FIXME
-- TSEmphasis = { }; -- For text to be represented with emphasis.
Expand All @@ -251,7 +251,7 @@ function M.setup(config)
htmlTag = {fg = c.fg},
htmlEndTag = {fg = c.fg},
htmlTagName = {fg = c.syntax.tag},
htmlArg = {fg = c.syntax.htmlArg},
htmlArg = {fg = c.syntax.html_arg},

-- javascript
javascriptTSType = {fg = c.fg},
Expand All @@ -264,7 +264,7 @@ function M.setup(config)
regexTSStringEscape = {fg = c.syntax.keyword},

-- json
jsonTSLabel = {fg = c.syntax.jsonLabel},
jsonTSLabel = {fg = c.syntax.json_label},

-- less
lessVariable = {fg = c.fg},
Expand Down Expand Up @@ -479,9 +479,7 @@ function M.setup(config)
theme.base.StatusLine = {bg = c.bg}

-- LuaLine
for _, section in pairs({"a", "b", "c"}) do
theme.plugins["lualine_" .. section .. "_inactive"] = inactive
end
for _, section in pairs({"a", "b", "c"}) do theme.plugins["lualine_" .. section .. "_inactive"] = inactive end
end
end

Expand Down
Loading

0 comments on commit 235247a

Please sign in to comment.