NTBBloodbath / doom-one.nvim

doom-emacs' doom-one Lua port for Neovim
MIT License
211 stars 32 forks source link

Consumeable color palette #25

Closed fitrh closed 2 years ago

fitrh commented 2 years ago

It would be useful if we could get the color palette so we could use consistent color when overriding highlight group.

For example, in tokyonight.nvim, we can do something like this

local colors = require("tokyonight.colors").setup({})
local utils = requires("tokyonight.util")

aplugin.background = colors.bg_dark
aplugin.my_error = util.brighten(colors.red1, 0.3)
NTBBloodbath commented 2 years ago

Hey, sorry for the late reply.

Can you please check if rewrite branch completely satisfies this feature request?

doom-one.nvim color palettes are now located at doom-one.colors in a table that is returned with two keys named dark and light respectively and you can doom-one.colors.get_palette(background) to get only the table with the desired background style colors.

Regarding to utility functions to lighten/darken or mix colors, that is already available in doom-one.utils.

Cheers

fitrh commented 2 years ago

Hey, sorry for the late reply.

No problem

Can you please check if rewrite branch completely satisfies this feature request?

Yes, the rewrite branch looks good.

What kind of bugs do you mean that you use global variable instead? Compared to option table which feels cleaner, and it doesn't pollute the global variable (IMO off course).

NTBBloodbath commented 2 years ago

Can you please check if rewrite branch completely satisfies this feature request?

Yes, the rewrite branch looks good.

Cool, I'll finish the light variant tweaks and plugins integrations to merge it. Thank you!

What kind of bugs do you mean that you use global variable instead? Compared to option table which feels cleaner, and it doesn't pollute the global variable (IMO off course).

17 is a great example, I didn't really find another clean way to fix this behavior (tried to read other colorschemes source code with a setup function to understand what I was doing wrong but it was like black magic to me haha).