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_hex
to output RGBA floats directly. We only use that function inside of_parse_color
, which needs RGBA floats as output. - No longer have
bytes
as 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
Figure
use the same types for width and height. Also a separate PR I think. Would be easiest to have_parse_size
just return a single string. - simplify the
_camelify
function. Is it even needed? - remove
get_templates