An open API service indexing awesome lists of open source software.

https://github.com/austinwilcox/hex2rgba

A Neovim plugin that convert hex values on a line of text into rgba values.
https://github.com/austinwilcox/hex2rgba

colors hex lua neovim rgba

Last synced: 10 months ago
JSON representation

A Neovim plugin that convert hex values on a line of text into rgba values.

Awesome Lists containing this project

README

          

# Hex 2 RGBA
I wrote this quick little plugin because I was getting design files that were using opacity with hex values, and I found it easier to switch those over to rgba and use that in my code.

## Packer
```lua
use "austinwilcox/hex2rgba"
```
## Lazy
```lua
{
"austinwilcox/hex2rgba"
}
```

Then add the following command in a lua file or your init.vim
```lua
local map = vim.api.nvim_set_keymap
map('n', 'cs', ':lua require("hex2rgba").hex2rgba()', { noremap = true })
```

Now with the keybinding of ```cs``` hex2rgba will find the first instance of a hex color value on the current line, and replace that with the correct rgba value.
If you execute the command again, it will look for another instance of a hex value. This will work with hex sizes of 3 or 6.

If you have any questions please feel free to reach out, or submit an issue.