mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-12-16 10:30:05 +01:00
- Add .pre-commit-config.yaml with initial config. - Add python black pre-commit config - Apply pre-commit code changes - Add information to CONTRIBUTING.md - Add pre-commit to build requirements - Run pre-commit during travis CI build - Use a travis build matrix to control when pre-commit runs in the CI process. Use explicit include to only run pre-commit on Python 3.9.
24 lines
612 B
Python
24 lines
612 B
Python
import anybadge
|
|
|
|
if __name__ == "__main__":
|
|
|
|
print(
|
|
"""| Color Name | Hex Code | Example |
|
|
| ---------- | -------- | ------- |"""
|
|
)
|
|
for color, hex in sorted(anybadge.COLORS.items()):
|
|
|
|
file = "examples/color_" + color + ".svg"
|
|
|
|
url = "https://cdn.rawgit.com/jongracecox/anybadge/master/" + file
|
|
|
|
anybadge.Badge(label="Color", value=color, default_color=color).write_badge(
|
|
file, overwrite=True
|
|
)
|
|
|
|
print(
|
|
"| {color} | {hex} |  |".format(
|
|
color=color, hex=hex.upper(), url=url
|
|
)
|
|
)
|