def filter.flood

gralha-svg-render@0.1.0.1 · svg.bend:4901

import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
import gralha-xml-doc@0.1.0.1/xml.bend as XML
import gralha-css-style@0.1.0.1/css.bend as CSS
import gralha-image@0.1.0.1/image.bend as Img

4901def filter.flood(+as: List<&2, XML.Attr>) -> Img.Color:
4902  +ink = XML.attr.get(as, "flood-color", "black")
4903  color.fade(color(U.choose(String, U.string.equal(CSS.css.lower(ink), "currentcolor"), XML.attr.get(as, "color", "black"), ink)), color.opacity(XML.attr.get(as, "flood-opacity", "1"), 1.0))

Uses (11)

Used by (2)