hoelzro/lua-term

Feature Request: Allow access to color number

bauen1 opened this issue · 1 comments

Some APIs (like this one: https://github.com/hoelzro/lua-linenoise) require you to pass the color as a number.
Exposing the raw number (https://github.com/hoelzro/lua-term/blob/master/term/colors.lua#L46-L77) using an additional field would be nice.

Thanks for the suggestion! I definitely think this should be doable (after all, return ' bold hints in red', { color = colors.red, bold = true } is in the lua-linenoise README), but I'm not 100% sure what the interface should look like. Ideally, linenoise would convert a table value like colors.red to a suitable number, but unfortunately there's no __tonumber metamethod, so I'm open to suggestions on the best way to do this!