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.
- Host: GitHub
- URL: https://github.com/austinwilcox/hex2rgba
- Owner: austinwilcox
- License: gpl-3.0
- Created: 2023-03-26T03:45:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T13:17:16.000Z (about 2 years ago)
- Last Synced: 2025-04-12T22:45:23.094Z (10 months ago)
- Topics: colors, hex, lua, neovim, rgba
- Language: Lua
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.