eww icon indicating copy to clipboard operation
eww copied to clipboard

[FEATURE] SVG multi color support via fill-svg

Open LurkAndLoiter opened this issue 3 months ago • 1 comments

Description of the requested feature

The fill-svg function currently accepts a single color and replaces the first instance of fill= in an SVG, typically the default color for undefined elements. For example:

<svg fill="default">
    <path/>
    <path fill="orange"/>
    <path/>
    <path fill="pink"/>
</svg>

In this example, paths 1 and 3 use the default fill, while paths 2 and 4 have defined fills that are not overridden. There is no method to override the fills for paths 2 and 4. I request that fill-svg support multiple fill= replacements for fully dynamic SVG colorization. Proposed implementation:

  • fill-svg "#FF0000": Accepts one argument, replacing the first fill= (maintains compatibility with existing functionality).
  • fill-svg "#FF0000,#00FF00": Replaces fill= instances up to the number of colors provided, leaving remaining fills unchanged.
  • fill-svg "#FF0000,#00FF00,#0000FF": Replaces all fill= instances in order.
  • fill-svg "#FF0000,,#0000FF": Uses CSV with blank entries (e.g., ,,) to skip specific fill= replacements.

This enhancement would allow premade SVG assets to be distributed with themes and dynamically altered by projects like pywal. It improves on tools like Nerd Fonts by enabling custom multi-color iconography with better size and alignment control.

Proposed configuration syntax

No response

Additional context

No response

LurkAndLoiter avatar Sep 13 '25 14:09 LurkAndLoiter

can i work on this

Sambhram1 avatar Oct 14 '25 14:10 Sambhram1