mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-09-05 23:50:07 +02:00
- Drop support for Python <3.7 - Bump the pre-commit version used in CI - Add type hinting and docstrings - Add mypy to pre-commit config - Fix typing issues - Update colors module - Update colors module to use uppercase hex codes - Add `__lt__` to allow sorting colors by name - Fix `build_examples.py` to work with color Enum - Update example badges in `README.md` - Fix typing issues in server - Update travis links in `README.md` - Fix PyPi deployment bug (#60)
23 lines
551 B
Python
23 lines
551 B
Python
# Set some defaults
|
|
from typing import Dict
|
|
|
|
DEFAULT_FONT: str = "DejaVu Sans,Verdana,Geneva,sans-serif"
|
|
DEFAULT_FONT_SIZE: int = 11
|
|
NUM_PADDING_CHARS: float = 0.5
|
|
DEFAULT_COLOR: str = "#4c1"
|
|
DEFAULT_TEXT_COLOR: str = "#fff"
|
|
MASK_ID_PREFIX: str = "anybadge_"
|
|
|
|
# Dictionary for looking up approx pixel widths of
|
|
# supported fonts and font sizes.
|
|
FONT_WIDTHS: Dict[str, Dict[int, int]] = {
|
|
"DejaVu Sans,Verdana,Geneva,sans-serif": {
|
|
10: 9,
|
|
11: 10,
|
|
12: 11,
|
|
},
|
|
"Arial, Helvetica, sans-serif": {
|
|
11: 8,
|
|
},
|
|
}
|