ubernostrum / webcolors

A library for working with HTML/CSS color formats in Python.

Home Page:https://webcolors.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conversion for RGBA

veljanin opened this issue · comments

Love the library and use it regularly for my projects!
It would be cool if there was the conversion to and from RGBA.
A in RGBA stands for Alpha and basically represents the opacity for each pixel (in %).
Perhaps it's possible to use the existing methods to convert the last 2 characters in 8 character HEX string into Alpha %.

The alpha-channel constructs aren't supported because there's really nothing to convert. If you have an rgba() color value, for example, and want to convert to hexadecimal, or to a name, you're only going to use the three color values, not the alpha-channel information 9which will be thrown away).