-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update extra colors #33
Comments
@craftzdog as an alternative, could you provide us with instructions on how should we run the generator for the extra colorschemes so we can export our extra styles locally? |
you can look into tokyonight's extra folder: https://github.com/folke/tokyonight.nvim/tree/main/lua/tokyonight/extra |
Oh, so from what I understand, you don't use the Solarized Osaka colors as terminal colors? You use Tokyo Night on the terminal and Solarized Osaka is just for Neovim? |
I made this adaptation for now: https://github.com/rxtsel/dot/blob/f92e1a4df849e69b664c1349140274af1bfa1dd9/.config/kitty/kitty.conf#L17 |
I had a look and it turns out the extras generation is completely broken. I would recommend deleting it for now imo. It seems the last thing needed to get this working is to map the unused variables to the correct value. For example I would love if someone had the time to make this work though, I had a play and ended up with this code for the time being. local M = {}
-- map of plugin name to plugin extension
--- @type table<string, {ext:string, url:string, label:string}>
-- stylua: ignore
M.extras = {
kitty = {ext = "conf", url = "https://sw.kovidgoyal.net/kitty/conf.html", label = "Kitty"},
fish = {ext = "fish", url = "https://fishshell.com/docs/current/index.html", label = "Fish"},
fish_themes = {ext = "theme", url = "https://fishshell.com/docs/current/interactive.html#syntax-highlighting", label = "Fish Themes"},
alacritty = {ext = "yml", url = "https://github.com/alacritty/alacritty", label = "Alacritty"},
wezterm = {ext = "toml", url = "https://wezfurlong.org/wezterm/config/files.html", label = "WezTerm"},
tmux = {ext = "tmux", url = "https://github.com/tmux/tmux/wiki", label = "Tmux"},
xresources = {ext = "Xresources", url = "https://wiki.archlinux.org/title/X_resources", label = "Xresources"},
xfceterm = {ext = "theme", url = "https://docs.xfce.org/apps/terminal/advanced", label = "Xfce Terminal"},
foot = {ext = "ini", url = "https://codeberg.org/dnkl/foot", label = "Foot"},
tilix = {ext = "json", url = "https://github.com/gnunn1/tilix", label = "Tilix"},
-- ERROR: this line crashes the program, probably would fix if the other issues are fixed though.
-- iterm = {ext = "itermcolors", url = "https://iterm2.com/", label = "iTerm"},
lua = {ext = "lua", url = "https://www.lua.org", label = "Lua Table for testing"},
sublime = {ext = "tmTheme", url = "https://www.sublimetext.com/docs/themes", label = "Sublime Text"},
delta = {ext = "gitconfig", url = "https://github.com/dandavison/delta", label = "Delta"},
terminator = {ext = "conf", url = "https://gnome-terminator.readthedocs.io/en/latest/config.html", label = "Terminator"},
prism = {ext = "js", url = "https://prismjs.com", label = "Prism"},
windows_terminal = {ext = "json", url = "https://aka.ms/terminal-documentation", label = "Windows Terminal"},
zathura = {ext = "zathurarc", url = "https://pwmt.org/projects/zathura/", label = "Zathura"},
dunst = {ext = "dunstrc", url = "https://dunst-project.org/", label = "Dunst"},
gitui = {ext = "ron", url = "https://github.com/extrawurst/gitui", label = "GitUI"},
}
local function write(str, fileName)
print("[write] extra/" .. fileName)
vim.fn.mkdir(vim.fs.dirname("extras/" .. fileName), "p")
local file = io.open("extras/" .. fileName, "w")
file:write(str)
file:close()
end
function M.read_file(file)
local fd = assert(io.open(file, "r"))
---@type string
local data = fd:read("*a")
fd:close()
return data
end
function M.write_file(file, contents)
local fd = assert(io.open(file, "w+"))
fd:write(contents)
fd:close()
end
function M.docs()
local file = vim.fn.fnamemodify(debug.getinfo(1, "S").source:sub(2), ":p:h:h:h:h") .. "/README.md"
local tag = "extras"
local pattern = "(<%!%-%- " .. tag .. ":start %-%->).*(<%!%-%- " .. tag .. ":end %-%->)"
local readme = M.read_file(file)
local lines = {}
local names = vim.tbl_keys(M.extras)
table.sort(names)
for _, name in ipairs(names) do
local info = M.extras[name]
table.insert(lines, "- [" .. info.label .. "](" .. info.url .. ") ([" .. name .. "](extras/" .. name .. "))")
end
readme = readme:gsub(pattern, "%1\n" .. table.concat(lines, "\n") .. "\n%2")
M.write_file(file, readme)
end
function M.setup()
M.docs()
local config = require("solarized-osaka.config")
-- map of style to style name
-- Remove the unused styles
local styles = {
night = "",
day = " Day",
}
for extra, info in pairs(M.extras) do
package.loaded["solarized-osaka.extra." .. extra] = nil
local plugin = require("solarized-osaka.extra." .. extra)
-- Enable the background for day and night? I think this is needed.
for style, style_name in pairs(styles) do
if style == "night" then
vim.o.background = "dark"
elseif style == "day" then
vim.o.background = "light"
end
config.setup({ style = style, use_background = "auto" })
local colors = require("solarized-osaka.colors").setup({ transform = true })
local fname = extra .. "/solarized_osaka_" .. style .. "." .. info.ext
colors["_upstream_url"] = "https://github.com/craftzdog/solarized-osaka.nvim/raw/main/extras/" .. fname
colors["_style_name"] = "Solarized Osaka" .. style_name
write(plugin.generate(colors), fname)
end
end
end
return M |
Any news on this front? Help needed? I'm interested in using this colorscheme outside of neovim |
If you can sit down and remap all the values from this scheme to the existing values, it would work. I don't have the design or aesthetic sense to do this however. Maybe give it a play though, it's probably not too hard! |
As far as I can see, this repo was a clone of folkes tokyo theme and a lot of unused code is still left in-place. His stuff is published under Apache2 license so we could reuse a lot of stuff. Filling the rest of the colors could be done by following @craftzdog 's figma file he linked to in readme I think the code as-is should be also cleaned in process (i.e., solarized-osaka doesn't have flavors night, storm, etc). As for testing, here I would blindly trust folke when reusing his scripts. I would test it in few tools (e.g. tmux, wezterm, kitty) and for the rest 🤷 |
The issue with this is you have to test with every application where it could work. I only use Kitty and Tmux from the listed options but the issue with those would be that when using nvim inside them the colors for status lines start blending too much.
Keeping the different colors for status line helps at least differentiate between which is which. I have tested with creating a build script that replicates these colors to some extent thanks to @ZeroEcks code snippet provided. If these colors are acceptable to some sense i can look into it further to implement this similar to how it functions for folke where you just run the script once and also remove all the legacy code left. |
Looks good! I do notice the "hidden items" in the second screenshot is almost illegible though. I don't have any time to contribute more but i would love to see this completed too.
…On Sat, 23 Nov 2024, at 11:26, Ahmed Mughal wrote:
The issue with this is you have to test with every application where it could work.
I only use Kitty and Tmux from the listed options but the issue with those would be that when using nvim inside them the colors for status lines start blending too much.
> These colors are generated from build script similar to how folke's works.
>
t_2024_11_23_06_18.png (view on web) <https://github.com/user-attachments/assets/63299073-d5e3-4175-b09a-01e9f8ee76a5>
Keeping the different colors for status line helps at least differentiate between which is which.
t_2024_11_23_06_22.png (view on web) <https://github.com/user-attachments/assets/6f31c942-47d0-46a2-a3e7-ff76ed9daa90>
I have tested with creating a build script that replicates these colors to some extent thanks to @ZeroEcks <https://github.com/ZeroEcks> code snippet provided.
If these colors are acceptable to some sense i can look into it further to implement this similar to how it functions for folke where you just run the script once and also remove all the legacy code left.
—
Reply to this email directly, view it on GitHub <#33 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAIOEXHYLOWUGG7KJ6HEDRD2B7KV7AVCNFSM6AAAAABHHFBUYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJVGE4DOMRTGY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
The "hidden items" part is actually not affected by the theme applied to the terminal but instead by the nvim theme. I would prefer it to be this so you could actually read what is going on but no idea if @craftzdog approves of this. |
@craftzdog for these to work properly instead of doing every single file individually and changing the values we can use the same variables and reassign them different colors and that would save a lot of time in making this work. Do tell which would be preferred cause editing every single file and adding those values is a lot of work while it can easily be solved to generate proper colors by just adding reassigning colors to match the conventions already written. This is also same how it is done in tokyonight for deprecated colors like it should also resolve this issue. |
For the time being all the values have been reassigned and I've made a separate file in case the maintainer wants to change those values later so it's easier to know what to change.
The only thing i couldn't figure out was the lua script written for iterm and i tested around a lot but failed with that so if someone understands their syntax of config better it would be appreciated if they help. This is my fork of this repo you can clone it and than Do inform me what you think and then when the maintainer responds i'll make a pull request. For easier testing you can add this to your existing require("lazy").setup({
dev = {
path = "~/Code/Neovim/",
}
}) Clone the repo in that path and change your return {
"craftzdog/solarized-osaka.nvim",
lazy = true,
dev = true,
opts = {
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
}
if you want to do it the old school way you can just change the {
"Redoxahmii/solarized-osaka.nvim",
lazy = true,
branch = "generator",
opts = {
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
}
|
Hi @redoxahmii, I'm trying to clone from your fork of the generator branch and I'm getting this error: |
Color files in extra, like kitty, still use tokyonight colors.
The text was updated successfully, but these errors were encountered: