Skip to content

Commit

Permalink
feat(extras): auto-generate extras (#37)
Browse files Browse the repository at this point in the history
* add helper functions for auto-generating extras

* add alacritty template

* small refactor + bug fixes

* add wezterm extra

* add lazygit extra

* add gitui extra

* add helix extra

* add tilux extra

* add textmate extra

* add pywal extra

* add windows terminal extra

* add fish extra

* add autogen workflow

* move workflow to correct dir

* delete extras ahead of auto generation

* chore: generate extras

---------

Co-authored-by: scottmckendry <[email protected]>
  • Loading branch information
scottmckendry and scottmckendry authored May 4, 2024
1 parent 03251ad commit 61b2a27
Show file tree
Hide file tree
Showing 23 changed files with 1,566 additions and 27 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/extras.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Generate Extras
on:
push:

jobs:
generate-extras:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: stable

- name: Generate Extras
run: |
nvim -u NONE -E -R --headless --cmd "set rtp^=." --cmd "lua require('cyberdream.extra').generate_all_extras()" --cmd qa
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: generate extras"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cyberdream theme for Alacritty
# cyberdream theme for alacritty
[[colors.indexed_colors]]
color = "0xffbd5e"
index = 16
Expand Down
22 changes: 11 additions & 11 deletions extras/fish/cyberdream.theme
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# name: 'cyberdream'
# url: 'https://github.com/scottmckendry/cyberdream.nvim'
# preferred_background: 16181A
# preferred_background: 16181a

fish_color_normal ffffff
fish_color_command 52cfff
fish_color_param f2cdcd
fish_color_command 5ef1ff
fish_color_param ffaecf
fish_color_keyword 5eff6c
fish_color_quote f1ff5e
fish_color_redirection 5ea1ff
fish_color_end bd5eff
fish_color_comment 7f849c
fish_color_comment 7b8496
fish_color_error ff6e5e
fish_color_gray 6c7086
fish_color_gray 7b8496
fish_color_selection --background=3c4048
fish_color_search_match --background=3c4048
fish_color_option f1ff5e
fish_color_operator 5ea1ff
fish_color_escape eba0ac
fish_color_autosuggestion 6c7086
fish_color_escape ffaecf
fish_color_autosuggestion 7b8496
fish_color_cancel ff6e5e
fish_color_cwd f9e2af
fish_color_user 94e2d5
fish_color_cwd ffbd5e
fish_color_user 5ef5d2
fish_color_host 5eff6c
fish_color_host_remote f1ff5e
fish_color_status ff6e5e
fish_pager_color_progress 6c7086
fish_pager_color_progress 7b8496
fish_pager_color_prefix 5ea1ff
fish_pager_color_completion ffffff
fish_pager_color_description 6c7086
fish_pager_color_description 7b8496
20 changes: 10 additions & 10 deletions extras/gitui/theme.ron → extras/gitui/cyberdream.ron
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
(
selected_tab: Rgb(5, 241, 255), // bright cyan for highlight
selected_tab: Rgb(94, 241, 255), // bright cyan for highlight
command_fg: Rgb(255, 255, 255), // white for commands foreground
selection_bg: Rgb(60, 64, 72), // darker grey for selection background
selection_fg: Rgb(255, 255, 255), // white for selected text
cmdbar_bg: Rgb(22, 24, 26), // very dark grey almost black for command bar background
cmdbar_extra_lines_bg: Rgb(22, 24, 26), // very dark grey almost black for extra lines in command bar
disabled_fg: Rgb(128, 135, 162), // a soft grey for disabled elements, adjusted to fit the theme
disabled_fg: Rgb(123, 132, 150), // a soft grey for disabled elements, adjusted to fit the theme
diff_line_add: Rgb(94, 255, 108), // vibrant green for added lines
diff_line_delete: Rgb(255, 110, 94), // vibrant red for deleted lines
diff_file_added: Rgb(241, 255, 94), // yellow for added files
diff_file_removed: Rgb(237, 135, 150), // light red for removed files
diff_file_removed: Rgb(255, 94, 160), // light red for removed files
diff_file_moved: Rgb(189, 94, 255), // purple for moved files
diff_file_modified: Rgb(94, 161, 255), // blue for modified files
commit_hash: Rgb(183, 189, 248), // light purplish for commit hashes
commit_time: Rgb(184, 192, 224), // greyish blue for commit time
commit_author: Rgb(125, 196, 228), // soft blue for author
commit_hash: Rgb(222, 174, 255), // light purplish for commit hashes
commit_time: Rgb(108, 146, 202), // greyish blue for commit time
commit_author: Rgb(94, 161, 255), // soft blue for author
danger_fg: Rgb(255, 110, 94), // vibrant red for danger
push_gauge_bg: Rgb(138, 173, 244), // soft blue for push gauge background
push_gauge_fg: Rgb(36, 39, 58), // dark blue for push gauge foreground
tag_fg: Rgb(244, 219, 214), // light pastel pink for tags
branch_fg: Rgb(139, 213, 202) // soft turquoise for branches
push_gauge_bg: Rgb(94, 161, 255), // soft blue for push gauge background
push_gauge_fg: Rgb(62, 97, 145), // dark blue for push gauge foreground
tag_fg: Rgb(255, 174, 207), // light pastel pink for tags
branch_fg: Rgb(94, 245, 210) // soft turquoise for branches
)
1 change: 1 addition & 0 deletions extras/helix/cyberdream.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# cyberdream theme for helix
"ui.background" = "bg"
"ui.text" = "fg"
"ui.cursor" = { bg = "fg", fg = "bg" }
Expand Down
1 change: 1 addition & 0 deletions extras/lazygit.yml → extras/lazygit/cyberdream.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/jesseduffield/lazygit/master/schema/config.json
# cyberdream theme for lazygit
gui:
border: rounded
theme:
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions extras/cyberdream.json → extras/tilix/cyberdream.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "cyberdream",
"comment": "A high-contrast, futuristic & vibrant colourscheme",
"background-color": "#16181A ",
"background-color": "#16181a",
"foreground-color": "#ffffff",
"badge-color": "#16181A ",
"badge-color": "#16181a",
"bold-color": "#5ef1ff",
"cursor-color": "#ffffff",
"highlight-background-color": "#3c4048",
Expand All @@ -18,7 +18,7 @@
"#5ef1ff",
"#ffffff",
"#3c4048",
"#ff6e5e",
#ff6e5e",
"#5eff6c",
"#f1ff5e",
"#5ea1ff",
Expand Down
3 changes: 2 additions & 1 deletion extras/wezterm.lua → extras/wezterm/cyberdream.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
-- cyberdream theme for wezterm
return {
foreground = "#ffffff",
background = "#16181a",

cursor_bg = "#ffffff",
cursor_fg = "#000000",
cursor_fg = "#16181a",
cursor_border = "#ffffff",

selection_fg = "#ffffff",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"background": "#16181A ",
"background": "#16181a",
"black": "#16181a",
"blue": "#5ea1ff",
"brightBlack": "#3c4048",
Expand Down
68 changes: 68 additions & 0 deletions lua/cyberdream/extra/alacritty.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
local colors = require("cyberdream.colors")
local util = require("cyberdream.util")

local M = {}

--- Format a color for use in allacritty.
--- @param hex string: The hex color to format. Must be in the format "#RRGGBB".
local function format_color(hex)
return "0x" .. string.sub(hex, 2)
end

--- Iterate over the colors in a table and format them.
--- @param t table: The table of colors to format.
local function format_colors(t)
local formatted = {}
for k, v in pairs(t) do
formatted[k] = format_color(v)
end
return formatted
end

--- Generate the theme for alacritty.
--- @param variant string: Variation of the colorscheme to use.
function M.generate(variant)
local t = format_colors(colors[variant])
local template = [==[
# cyberdream theme for alacritty
[[colors.indexed_colors]]
color = "${orange}"
index = 16
[[colors.indexed_colors]]
color = "${red}"
index = 17
[colors.bright]
black = "${bgHighlight}"
blue = "${blue}"
cyan = "${cyan}"
green = "${green}"
magenta = "${purple}"
red = "${red}"
white = "${fg}"
yellow = "${yellow}"
[colors.normal]
black = "${bg}"
blue = "${blue}"
cyan = "${cyan}"
green = "${green}"
magenta = "${purple}"
red = "${red}"
white = "${fg}"
yellow = "${yellow}"
[colors.primary]
background = "${bg}"
foreground = "${fg}"
[colors.selection]
background = "${bgHighlight}"
foreground = "${fg}"
]==]

return util.parse_extra_template(template, t)
end

return M
64 changes: 64 additions & 0 deletions lua/cyberdream/extra/fish.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
local colors = require("cyberdream.colors")
local util = require("cyberdream.util")

local M = {}

--- Format a color for use in fish.
--- @param hex string: The hex color to format. Must be in the format "#RRGGBB".
local function format_color(hex)
return string.sub(hex, 2)
end

--- Iterate over the colors in a table and format them.
--- @param t table: The table of colors to format.
local function format_colors(t)
local formatted = {}
for k, v in pairs(t) do
formatted[k] = format_color(v)
end
return formatted
end

--- Generate the theme for fish.
--- @param variant string: Variation of the colorscheme to use.
function M.generate(variant)
local t = format_colors(colors[variant])
t.pastel_pink = format_color(util.blend(colors[variant].fg, colors[variant].pink))
t.turquoise = format_color(util.blend(colors[variant].green, colors[variant].cyan, 0.3))
local template = [==[
# name: 'cyberdream'
# url: 'https://github.com/scottmckendry/cyberdream.nvim'
# preferred_background: ${bg}
fish_color_normal ${fg}
fish_color_command ${cyan}
fish_color_param ${pastel_pink}
fish_color_keyword ${green}
fish_color_quote ${yellow}
fish_color_redirection ${blue}
fish_color_end ${purple}
fish_color_comment ${grey}
fish_color_error ${red}
fish_color_gray ${grey}
fish_color_selection --background=${bgHighlight}
fish_color_search_match --background=${bgHighlight}
fish_color_option ${yellow}
fish_color_operator ${blue}
fish_color_escape ${pastel_pink}
fish_color_autosuggestion ${grey}
fish_color_cancel ${red}
fish_color_cwd ${orange}
fish_color_user ${turquoise}
fish_color_host ${green}
fish_color_host_remote ${yellow}
fish_color_status ${red}
fish_pager_color_progress ${grey}
fish_pager_color_prefix ${blue}
fish_pager_color_completion ${fg}
fish_pager_color_description ${grey}
]==]

return util.parse_extra_template(template, t)
end

return M
66 changes: 66 additions & 0 deletions lua/cyberdream/extra/gitui.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
local colors = require("cyberdream.colors")
local util = require("cyberdream.util")

local M = {}

--- Format a color for use in gitui
--- @param hex string: The hex color to formatted. Must be in the format "#RRGGBB".
local function format_color(hex)
local r = tonumber(string.sub(hex, 2, 3), 16)
local g = tonumber(string.sub(hex, 4, 5), 16)
local b = tonumber(string.sub(hex, 6, 7), 16)

return string.format("%d, %d, %d", r, g, b)
end

--- Iterate over the colors in a table and format them.
--- @param t table: The table of colors to formaunformatted.
local function format_colors(t)
local formatted = {}
for k, v in pairs(t) do
formatted[k] = format_color(v)
end
return formatted
end

--- Generate the theme for gitui
--- @param variant string: Variation of the colorscheme to use.
function M.generate(variant)
local unformatted = colors[variant]
unformatted.light_purple = util.blend(unformatted.fg, unformatted.purple)
unformatted.grey_blue = util.blend(unformatted.grey, unformatted.blue)
unformatted.dark_blue = util.blend(unformatted.bgAlt, unformatted.blue)
unformatted.pastel_pink = util.blend(unformatted.fg, unformatted.pink)
unformatted.turquoise = util.blend(unformatted.green, unformatted.cyan, 0.3)

local t = format_colors(unformatted)
local template = [==[
(
selected_tab: Rgb(${cyan}), // bright cyan for highlight
command_fg: Rgb(${fg}), // white for commands foreground
selection_bg: Rgb(${bgHighlight}), // darker grey for selection background
selection_fg: Rgb(${fg}), // white for selected text
cmdbar_bg: Rgb(${bg}), // very dark grey almost black for command bar background
cmdbar_extra_lines_bg: Rgb(${bg}), // very dark grey almost black for extra lines in command bar
disabled_fg: Rgb(${grey}), // a soft grey for disabled elements, adjusted to fit the theme
diff_line_add: Rgb(${green}), // vibrant green for added lines
diff_line_delete: Rgb(${red}), // vibrant red for deleted lines
diff_file_added: Rgb(${yellow}), // yellow for added files
diff_file_removed: Rgb(${pink}), // light red for removed files
diff_file_moved: Rgb(${purple}), // purple for moved files
diff_file_modified: Rgb(${blue}), // blue for modified files
commit_hash: Rgb(${light_purple}), // light purplish for commit hashes
commit_time: Rgb(${grey_blue}), // greyish blue for commit time
commit_author: Rgb(${blue}), // soft blue for author
danger_fg: Rgb(${red}), // vibrant red for danger
push_gauge_bg: Rgb(${blue}), // soft blue for push gauge background
push_gauge_fg: Rgb(${dark_blue}), // dark blue for push gauge foreground
tag_fg: Rgb(${pastel_pink}), // light pastel pink for tags
branch_fg: Rgb(${turquoise}) // soft turquoise for branches
)
]==]

return util.parse_extra_template(template, t)
end

return M
Loading

0 comments on commit 61b2a27

Please sign in to comment.