Skip to content

Commit

Permalink
feat(extras): update zed windows and search highlights
Browse files Browse the repository at this point in the history
* feat(extras-zed): Add background and search highlight colors

* chore: generate extras

---------

Co-authored-by: byt3m4st3r <[email protected]>
  • Loading branch information
byt3m4st3r and byt3m4st3r authored Aug 29, 2024
1 parent f86f4ac commit 6689105
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
13 changes: 5 additions & 8 deletions extras/zed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ Open [Zed](https://zed.dev) and select the theme under `Settings -> Select Theme
Alternatively, put the following config into your `settings.json` under `~/.config/zed`.

```json
// settings.json
{
// ---
"theme": {
"mode": "system",
"light": "Cyberdream light",
"dark": "Cyberdream dark"
}
// ---
"theme": {
"mode": "system",
"light": "Cyberdream light",
"dark": "Cyberdream dark"
}
}
```

Expand Down
10 changes: 5 additions & 5 deletions extras/zed/cyberdream-light.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"title_bar.background": null,
"toolbar.background": "#ffffff",
"tab_bar.background": null,
"tab.inactive_background": null,
"tab.active_background": null,
"search.match_background": null,
"panel.background": null,
"tab.inactive_background": "#ffffff",
"tab.active_background": "#eaeaea",
"search.match_background": "#d17c0080",
"panel.background": "#ffffff",
"panel.focused_border": null,
"pane.focused_border": null,
"pane_group.border": null,
Expand All @@ -71,7 +71,7 @@
"editor.indent_guide_active": null,
"editor.document_highlight.read_background": null,
"editor.document_highlight.write_background": null,
"terminal.background": null,
"terminal.background": "#ffffff",
"terminal.foreground": null,
"terminal.bright_foreground": null,
"terminal.dim_foreground": null,
Expand Down
10 changes: 5 additions & 5 deletions extras/zed/cyberdream.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"title_bar.background": null,
"toolbar.background": "#16181a",
"tab_bar.background": null,
"tab.inactive_background": null,
"tab.active_background": null,
"search.match_background": null,
"panel.background": null,
"tab.inactive_background": "#16181a",
"tab.active_background": "#1e2124",
"search.match_background": "#ffbd5e80",
"panel.background": "#16181a",
"panel.focused_border": null,
"pane.focused_border": null,
"pane_group.border": null,
Expand All @@ -71,7 +71,7 @@
"editor.indent_guide_active": null,
"editor.document_highlight.read_background": null,
"editor.document_highlight.write_background": null,
"terminal.background": null,
"terminal.background": "#16181a",
"terminal.foreground": null,
"terminal.bright_foreground": null,
"terminal.dim_foreground": null,
Expand Down
22 changes: 14 additions & 8 deletions lua/cyberdream/extra/zed.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ local M = {}
--- Generate cyberdream theme for https://zed.dev/
--- @param variant string: Variation of the colorscheme to use.
function M.generate(variant)
local modified_colors = vim.fn.copy(colors[variant])
modified_colors.variant = variant == "default" and "dark" or "light"
local extended_colors = vim.fn.copy(colors[variant])

for key, value in pairs(colors[variant]) do
extended_colors[key .. "Alpha"] = value .. "80" -- 50% transparency
end

extended_colors.variant = variant == "default" and "dark" or "light"

local template = [==[
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
Expand Down Expand Up @@ -55,10 +61,10 @@ function M.generate(variant)
"title_bar.background": null,
"toolbar.background": "${bg}",
"tab_bar.background": null,
"tab.inactive_background": null,
"tab.active_background": null,
"search.match_background": null,
"panel.background": null,
"tab.inactive_background": "${bg}",
"tab.active_background": "${bgAlt}",
"search.match_background": "${orangeAlpha}",
"panel.background": "${bg}",
"panel.focused_border": null,
"pane.focused_border": null,
"pane_group.border": null,
Expand All @@ -82,7 +88,7 @@ function M.generate(variant)
"editor.indent_guide_active": null,
"editor.document_highlight.read_background": null,
"editor.document_highlight.write_background": null,
"terminal.background": null,
"terminal.background": "${bg}",
"terminal.foreground": null,
"terminal.bright_foreground": null,
"terminal.dim_foreground": null,
Expand Down Expand Up @@ -330,7 +336,7 @@ function M.generate(variant)
}
]==]

return util.parse_extra_template(template, modified_colors)
return util.parse_extra_template(template, extended_colors)
end

return M

0 comments on commit 6689105

Please sign in to comment.