Files
anybadge/anybadge/config.py
Jon Grace-Cox 8a434d95b5 Drop <3.7 support and add type hints (#59)
- 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)
2022-08-08 23:19:50 -04:00

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,
},
}