kat.nvim icon indicating copy to clipboard operation
kat.nvim copied to clipboard

Easily accesible color module

Open katawful opened this issue 2 years ago • 1 comments

For #16

Easy color access is to be addressed with this. The general idea is to expose a general list of colors, on demand, only using the main colors.fnl file. This will let end users to more easily add support for various plugins and the like.

katawful avatar Jul 04 '22 02:07 katawful

Decided on more explicit information at the cost of verbosity. Each predefined color table contains tables of the exported colors. For instance, to access the base pink color from this theme you would do:

local colors = require('katdotnvim.utils.export.colors')
print(colors.kat.pink.base.color)

This, of course, comes with a lot more verbosity but it allows me to add a key called desc to the table that gives a far more informative about the color in question. And of course you can assign a different variable to whatever internal color

local pink = require('katdotnivm.utils.export.colors').kat.pink
print(pink.base.desc) -- prints "base color"

I cannot think of a better way to provide clear information to end users

katawful avatar Jul 19 '22 02:07 katawful

I added most of the colors used in my colorscheme finally. Should finally be nearing for release after all this time

katawful avatar Aug 23 '22 15:08 katawful

The exportable colors have been moved from katdotnvim.utils.export.colors to katdotnvim.color. I will, in a later PR, move all colors to take basis on this updated file format. It is outside the scope of this PR

Docs are the last thing needed

katawful avatar Aug 23 '22 17:08 katawful