Convert opacity percentage into a hex value, or opacity hex to percent value.
After getting tired of always googling this gist https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 to convert opacity into hex value decided to create this nifty npm package to quickly convert any opacity value into hex directly in my cli.
npm install -g @mskri/hex-opacity
Convert percent to hex
hex-opacity <percent value>
// or
hex-opacity --percent <percent value>
Convert hex to percent
hex-opacity <hex value>
// or
hex-opacity --hex <hex value>
$ hex-opacity 100
FF
$ hex-opacity --percent 50
80
You can also include the percentage sign if you want
$ hex-opacity 50%
80
$ hex-opacity 0xFF
100%
$ hex-opacity --hex 0x80
50%