Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

harmonize color regex & ignore SVG default black #327

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

xerc
Copy link

@xerc xerc commented Mar 13, 2024

found the last one ;)

@xerc xerc changed the title harmonize color regex harmonize color regex & ignore SVG default color(s) Mar 14, 2024
@xerc
Copy link
Author

xerc commented Mar 14, 2024

@metafloor do you remember/know if fill-rule="evenodd" is only used for maxicodes inner rings ?

@metafloor
Copy link
Owner

All of the drawing in BWIPP uses the postscript default nonzero winding rule. But the filled regions never intersect, so it doesn't have any effect.

@metafloor
Copy link
Owner

What are you trying to achieve with testing for white background and path filling? Is it a bug you have found or something else?

@xerc
Copy link
Author

xerc commented Mar 15, 2024

after sleeping this would be the best solution to ignore SVG default fill color if it is "black"
could even change the "header" to <svg [..] fill-rule="evenodd" stroke="currentColor" fill="currentColor"> for more flexibility afterwards

@xerc xerc changed the title harmonize color regex & ignore SVG default color(s) harmonize color regex & ignore SVG default black Mar 15, 2024
@metafloor
Copy link
Owner

I don't see the need for this and it breaks backward compatibility. Since you won't explain why you want this change, I will assume it's to allow css rules to specify the fill.

If that's the case, just use a regexp to get rid of the fills. Something like:

svg = svg.replace(/ fill="#[0-9A-Fa-f]{6}"/g, '')

A similar approach can be used with stroke color as well.

@xerc
Copy link
Author

xerc commented Mar 16, 2024

I don't see the need for this and it breaks backward compatibility. Since you won't explain why you want this change

not shure what to explain ; SVG default color is/was always black

bwt/ the info about currentColor was just a question if you "like" =-> already using replace 4 cleanup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants