Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ext/pyhtmlcolor
Parsing HTML and CSS color values
https://github.com/ext/pyhtmlcolor
Last synced: 28 days ago
JSON representation
Parsing HTML and CSS color values
- Host: GitHub
- URL: https://github.com/ext/pyhtmlcolor
- Owner: ext
- License: bsd-3-clause
- Created: 2010-06-25T07:56:10.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-06-28T09:47:42.000Z (over 14 years ago)
- Last Synced: 2024-08-09T05:39:05.954Z (3 months ago)
- Language: Python
- Homepage:
- Size: 120 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: COPYING
Awesome Lists containing this project
README
The htmlcolor module parses HTML/CSS colors. It accepts regular hexadecimal
notation, CSS shorthand notation and named colors. In addition it also supports
four-component colors such as RGBA.>>> import htmlcolor
>>> parser = htmlcolor.Parser()
>>> parser.parse('#ff7700')
(255, 119, 0)
>>> parser.parse('#f70')
(255, 119, 0)
>>> parser.parse('hotpink')
(255, 105, 180)
>>> parser.parse('ff7700')
(255, 119, 0)