mistricky / codesnap.nvim

📸 Snapshot plugin with rich features that can make pretty code snapshots for Neovim
MIT License
483 stars 16 forks source link

[Feat] support RGBA values as background color #52

Closed mrWinston closed 2 months ago

mrWinston commented 3 months ago

This PR makes sure, that the bg_color setting value also supports specifying the alpha channel in the format #RRGGBBAA. Omitting the alpha channel value results in the same behaviour as before, so this change should not break any existing configurations.

Codewise, the main change is that i moved the validation of the bg_color string into it's own function and added a short snippet to extract the alpha channel value from the bg_color or 255 if it's not specified. Let me know if this looks ok style wise, i'm very very new to rust :)

examples

mistricky commented 3 months ago

Nice job! It would be great if treating all RGB color as RGBA color. If the user pass RGB hex color, convert it to RGBA color with ff alpha channel, if we do this, we only need to handle the RGBA processing logic.