mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-09-07 08:30:08 +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
607 B
Python
23 lines
607 B
Python
import anybadge
|
|
|
|
if __name__ == "__main__":
|
|
|
|
print(
|
|
"""
|
|
| Color Name | Hex | Example |
|
|
| ------------- | ------- | ------- |"""
|
|
)
|
|
for color in sorted(anybadge.colors.Color):
|
|
|
|
file = "examples/color_" + color.name.lower() + ".svg"
|
|
|
|
url = "https://cdn.rawgit.com/jongracecox/anybadge/master/" + file
|
|
|
|
anybadge.Badge(
|
|
label="Color", value=color.name.lower(), default_color=color.value
|
|
).write_badge(file, overwrite=True)
|
|
|
|
print(
|
|
f"| {color.name.lower():<13} | {color.value.upper():<7} | ':<84}|"
|
|
)
|