Files
anybadge/build_examples.py
Jon Grace-Cox aeedfbb93d Fix padding issues (#38)
* Set default padding chars to 0.5.
* Split num_padding_chars into num_label_padding_chars and num_value_padding_chars
  to allow better control. Retain num_padding_chars as an input parameter, but
  internally it is dropped.
* Remove padding multipliers.
* Add measurements image for developers. Helps show what each of the internal
  measurements are.
* Add script to build example badges.
* Update example badges.

Reliability
=======

* Raise a value error if an invalid font is passed.
* Handle labels that are not passed as str.
* Raise a value error if an invalid color name is passed.

Testing
=======

* Expand doctests to increase test coverage.
* Add Arial size 11 font and extra font sizes (mainly for testing).
* Make parse_args and main more testable by taking args as an input parameter.
* Use useful badge text in unittest badges.
* Add template svg file for testing.
* Add HTML coverage generation to travis yaml.
2020-03-15 12:51:34 -04:00

16 lines
524 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} | ![]({url}) |".format(color=color, hex=hex.upper(), url=url))