pydantic / pydantic-extra-types

Extra Pydantic types.
MIT License
181 stars 48 forks source link

Support `transparent` Color #58

Closed CollinHeist closed 1 year ago

CollinHeist commented 1 year ago

Note: See https://github.com/pydantic/pydantic/issues/6026 for the original issue

As of CSS3, the transparent color is supposed to be supported in all color fields, and is equivalent to rgba(0, 0, 0, 0). From the CSS3 website:

CSS3 extends the color value to include the ‘transparent’ keyword to allow its use with all properties that accept a value. This simplifies the definition of those properties in CSS3. transparent Fully transparent. This keyword can be considered a shorthand for transparent black, rgba(0,0,0,0), which is its computed value.

I'll submit a PR here shortly, as the implementation should be fairly simple.

samuelcolvin commented 1 year ago

👍 sounds good.

yezz123 commented 1 year ago

Merged https://github.com/pydantic/pydantic-extra-types/pull/59

Thank you @CollinHeist 🙏🏻