add text_fill option
This commit is contained in:
@@ -29,3 +29,4 @@ command = [ "python", "./res/pdweather.py" ]
|
|||||||
font = "./res/curie.bdf"
|
font = "./res/curie.bdf"
|
||||||
text_filters = [ "lowercase" ]
|
text_filters = [ "lowercase" ]
|
||||||
text_offset = [45, 4]
|
text_offset = [45, 4]
|
||||||
|
text_fill = [255, 255, 255] # your template image must have alpha channel to use alpha
|
||||||
|
|||||||
@@ -44,7 +44,9 @@ def generate(config):
|
|||||||
elif filter == "uppercase":
|
elif filter == "uppercase":
|
||||||
text = text.upper()
|
text = text.upper()
|
||||||
|
|
||||||
draw.text(config.get('text_offset', [0, 0]), text, font=font, fill=(255, 255, 255, 255))
|
fill = config.get('text_fill')
|
||||||
|
fill = tuple(fill) if fill else None
|
||||||
|
draw.text(config.get('text_offset', [0, 0]), text, font=font, fill=fill)
|
||||||
|
|
||||||
img.save(config['output'], save_all=True)
|
img.save(config['output'], save_all=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user