branca
branca copied to clipboard
Add type hints
- [x] Add type hints to all modules in Branca.
- [x] Make sure Mypy passes.
Contains some functional changes as well:
- Alter
_parse_hexto output RGBA floats directly. We only use that function inside of_parse_color, which needs RGBA floats as output. - No longer have
bytesas accepted type for color strings. That's a remnant from the Python 2 times. - Merge duplicate code in Link, JavascriptLink and CssLink.
Do separately later:
- make subclasses of
Figureuse the same types for width and height. Also a separate PR I think. Would be easiest to have_parse_sizejust return a single string. - simplify the
_camelifyfunction. Is it even needed? - remove
get_templates