summaryrefslogtreecommitdiff
path: root/pygments/lexers/_postgres_builtins.py
diff options
context:
space:
mode:
authorHector Medina <hector.f.medina.a@gmail.com>2021-02-14 03:01:05 -0500
committerGitHub <noreply@github.com>2021-02-14 09:01:05 +0100
commite59ec24561357c9d5efa4cfcda0401e0a79df91d (patch)
treef48486533ccb868a55c3eec1688e6338995fab3e /pygments/lexers/_postgres_builtins.py
parent3c06350da8de5dfd712e0122610c7b10574fe371 (diff)
downloadpygments-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