Skip to content

Commit

Permalink
feat(extras): Add rio terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3m4st3r committed Jul 26, 2024
1 parent fb68c91 commit 8109315
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/cyberdream/extra/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ M.extras = {
lazydocker = { extension = "yml", name = "lazydocker" },
lazygit = { extension = "yml", name = "lazygit" },
pywal = { extension = "json", name = "pywal" },
rio = { extension = "toml", name = "rio" },
textmate = { extension = "tmTheme", name = "textmate" },
tilix = { extension = "json", name = "tilix" },
tmux = { extension = "tmuxtheme", name = "tmux" },
Expand Down
82 changes: 82 additions & 0 deletions lua/cyberdream/extra/rio.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
local colors = require("cyberdream.colors")
local util = require("cyberdream.util")

local M = {}

--- Generate cyberdream theme for https://zed.dev/
--- @param variant string: Variation of the colorscheme to use.
function M.generate(variant)
function CreateDimColor(hex)
return M.blend(hex, colors[variant].bg, 0.8)
end

function CreateLightColor(hex)
return M.blend(hex, colors[variant].fg, 0.8)
end

local modified_colors = vim.fn.copy(colors[variant])
modified_colors.bgAltDim = CreateDimColor(colors[variant].bgAlt)
modified_colors.blueDim = CreateDimColor(colors[variant].blue)
modified_colors.cyanDim = CreateDimColor(colors[variant].cyan)
modified_colors.fgDim = CreateDimColor(colors[variant].fg)
modified_colors.greenDim = CreateDimColor(colors[variant].green)
modified_colors.magentaDim = CreateDimColor(colors[variant].magenta)
modified_colors.redDim = CreateDimColor(colors[variant].red)
modified_colors.yellowDim = CreateDimColor(colors[variant].yellow)
modified_colors.bgAltLight = CreateLightColor(colors[variant].bgAlt)
modified_colors.blueLight = CreateLightColor(colors[variant].blue)
modified_colors.cyanLight = CreateLightColor(colors[variant].cyan)
modified_colors.fgLight = CreateLightColor(colors[variant].fg)
modified_colors.greenLight = CreateLightColor(colors[variant].green)
modified_colors.magentaLight = CreateLightColor(colors[variant].magenta)
modified_colors.redLight = CreateLightColor(colors[variant].red)
modified_colors.yellowLight = CreateLightColor(colors[variant].yellow)

local template = [==[
[colors]
# Regular colors
background = '${bg}'
black = '${bgAlt}'
blue = '${blue}'
cursor = '${fg}'
cyan = '${cyan}'
foreground = '${fg}'
green = '${green}'
magenta = '${magenta}'
red = '${red}'
white = '${fg}'
yellow = '${yellow}'
# UI colors
tabs = '${bgHighlight}'
tabs-active = '${grey}'
selection-foreground = '${fg}'
selection-background = '${bgAlt}'
# Dim colors
dim-black = '${bgAltDim}'
dim-blue = '${blueDim}'
dim-cyan = '${cyanDim}'
dim-foreground = '${fgDim}'
dim-green = '${greenDim}'
dim-magenta = '${magentaDim}'
dim-red = '${redDim}'
dim-white = '${fgDim}'
dim-yellow = '${yellowDim}'
# Light colors
light-black = '${bgAltLight}'
light-blue = '${blueLight}'
light-cyan = '${cyanLight}'
light-foreground = '${fgLight}'
light-green = '${greenLight}'
light-magenta = '${magentaLight}'
light-red = '${redLight}'
light-white = '${fgLight}'
light-yellow = '${yellowLight}'
]==]

return util.parse_extra_template(template, modified_colors)
end

return M

0 comments on commit 8109315

Please sign in to comment.