Skip to main content
CI status image

webcolors is a module for working with and converting between the various HTML/CSS color formats.

Support is included for normalizing and converting between the following formats (RGB colorspace only; conversion to/from HSL can be handled by the colorsys module in the Python standard library):

  • Specification-defined color names

  • Six-digit hexadecimal

  • Three-digit hexadecimal

  • Integer rgb() triplet

  • Percentage rgb() triplet

For example:

>>> import webcolors
>>> webcolors.hex_to_name("#daa520")
'goldenrod'

Implementations are also provided for the HTML5 color parsing and serialization algorithms. For example, parsing the infamous “chucknorris” string into an rgb() triplet:

>>> import webcolors
>>> webcolors.html5_parse_legacy_color("chucknorris")
HTML5SimpleColor(red=192, green=0, blue=0)

Full documentation is available online.

Metadata

Release files for webcolors 25.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webcolors 25.10.0
File Size Uploaded
webcolors-25.10.0.tar.gz 53.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for webcolors 25.10.0
File Interpreter ABI Platform
webcolors-25.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 68.4 kB

Release files / webcolors-25.10.0.tar.gz

Download URL webcolors-25.10.0.tar.gz
Size 53.5 kB
Tags Source
SHA-256 checksum
How to use checksums
62abae86504f66d0f6364c2a8520de4a0c47b80c03fc3a5f1815fedbef7c19bf
BLAKE2b-256 checksum
How to use checksums
1d7aeb316761ec35664ea5174709a68bbd3389de60d4a1ebab8808bfc264ed67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.0 CPython/3.13.0

Release files / webcolors-25.10.0-py3-none-any.whl

Download URL webcolors-25.10.0-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
032c727334856fc0b968f63daa252a1ac93d33db2f5267756623c210e57a4f1d
BLAKE2b-256 checksum
How to use checksums
e2cce097523dd85c9cf5d354f78310927f1656c422bd7b2613b2db3e3f9a0f2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.0 CPython/3.13.0

Release history Release notifications | RSS feed

This release

25.10.0 This release

2 release files

24.8.0

2 release files

1.13

2 release files

1.12

2 release files

1.11.1

2 release files

1.11

2 release files

1.10

2 release files

1.9.1

2 release files

1.9

2 release files

1.8.1

2 release files

1.8

1 release file

1.7

1 release file

1.5

1 release file

1.4

1 release file

1.3.1

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page