-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support for non-RGB terminal color #50
Comments
Since highlight groups are created on the fly, it is indeed not currently possible to simply define them yourself. -- In a .lua script
local config = require("smear_cursor.config")
local color = require("smear_cursor.color")
for i = 1, config.color_levels do
color.get_hl_group({ level = i })
color.get_hl_group({ level = i, inverted = true })
end
-- Then define your highlight groups The name of the highlight groups are We'll have to make it easier somehow. Good luck |
Hmm thx for the scaffold. |
If you don't use a font that has legacy computing symbols, some block symbols will be missing their symmetric counterpart. Still, they can be rendered using inverted foreground and background colors on available symbols for a similar effect. You can use the same colors with |
For the record, this is what I use now: -- @2024-12 the plugin doesn't expose a way to customize hl groups as they are created
-- on-the-fly based on various RGB colors (not terminal colors).
-- So we need to get creative, and manually trigger group creation and override them.
-- REF: https://github.com/sphamba/smear-cursor.nvim/issues/50#issuecomment-2525347852
local config = require("smear_cursor.config")
local color = require("smear_cursor.color")
for i = 1, config.color_levels do
color.get_hl_group({ level = i })
-- note: my config doesn't seem to ever use the inverted color groups
-- color.get_hl_group({ level = i, inverted = true })
end
-- NOTE: assert(#palette == config.color_levels) !
local smear_palette_fire = {
{ ctermfg = 137 },
{ ctermfg = 136 },
{ ctermfg = 130 },
{ ctermfg = 166 },
}
local smear_palette_darkwhite = {
{ ctermfg = 235 },
{ ctermfg = 240 },
{ ctermfg = 245 },
{ ctermfg = 255 },
}
local smear_palette = smear_palette_fire
for i, hl_spec in ipairs(smear_palette) do
vim.api.nvim_set_hl(0, "SmearCursorNormal"..i, hl_spec)
end Peek.2024-12-15.08-36.mp4❤️ ✨ Some day I might do a PR, let's keep open 🤔 |
Hmm it's not working perfectly well though, when I re-apply my colorscheme, the colors are back to white, even if I re-run the code I posted above 🤔 |
Awesome thanks a lot it's great now ✨ ✨ ✨ ❤️ |
When
termguicolors
is not set in neovim, there is no way to configure the cursor color.I'm aware you have code to manipulate RGB to apply gamma / transparency / color blending.
But I really only need (I think?) a ramp of colors, which I could give with multiple groups using the 256-colors palette 🤔
The text was updated successfully, but these errors were encountered: