GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — WIP: Add support for blend modes in SVG backend · matplotlib/matplotlib@bb554e7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/matplotlib/backends
    • backend_svg.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/matplotlib/backends/backend_svg.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_svg.py
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,23 @@ def _get_style_dict(self, gc, rgbFace):
582582
if forced_alpha and gc.get_alpha() != 1.0:
583583
attrib['opacity'] = _short_float_fmt(gc.get_alpha())
584584

585+
supported_blend_modes = {
586+
"multiply": "multiply",
587+
"screen": "screen",
588+
"overlay": "overlay",
589+
"darken": "darken",
590+
"lighten": "lighten",
591+
"color dodge": "color-dodge",
592+
"color burn": "color-burn",
593+
"hard light": "hard-light",
594+
"soft light": "soft-light",
595+
"difference": "difference",
596+
"exclusion": "exclusion",
597+
}
598+
if (blend_mode := gc.get_blend_mode()) != "over":
599+
if blend_mode in supported_blend_modes:
600+
attrib["mix-blend-mode"] = supported_blend_modes[blend_mode]
601+
585602
offset, seq = gc.get_dashes()
586603
if seq is not None:
587604
attrib['stroke-dasharray'] = ','.join(

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.