diff options
author | Hector Medina <hector.f.medina.a@gmail.com> | 2021-02-14 03:01:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-14 09:01:05 +0100 |
commit | e59ec24561357c9d5efa4cfcda0401e0a79df91d (patch) | |
tree | f48486533ccb868a55c3eec1688e6338995fab3e /pygments/lexers/_postgres_builtins.py | |
parent | 3c06350da8de5dfd712e0122610c7b10574fe371 (diff) | |
download | pygments-git-e59ec24561357c9d5efa4cfcda0401e0a79df91d.tar.gz |
image formatter supports background color (#1374)
Extend Image formatters in img.py to support background colors.
* New function to get the background color for a given token type, optionally None
* The self.drawables list used the fill keyword, stuffed into a **kwrgs, for the color of the token; since tokens can have foreground and background colors, that list now uses two explicit names, passing one to the PIL/Pillow text draw call, the other to the rectangle draw call.
* When iterating over the `drawables` list, the presence of a background color triggers the drawing of a rectangle beneath the text.
* Dimensions of background rectangle calculated by PIL based on the rendered text and font.
* If input string is multiline, PIL will use multiline for draw and size internally.
Diffstat (limited to 'pygments/lexers/_postgres_builtins.py')
0 files changed, 0 insertions, 0 deletions