-
Notifications
You must be signed in to change notification settings - Fork 228
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
Fill:"None" not working, fills as black color #171
Comments
The css color names has "none" for "#00000000", which works fine for parsing the color hex string. But I guess when fill-opacity is not set, its default value is 1 so it overwrites the alpha of the fill color. |
I am hitting the same issue, but it's with all literal colors i.e. fill="white" still will fill with black color, but fill="#FFFFFF" works. Maybe it's not specific to none? |
Anyone can look at this issue? I am using Cocoapods with the latest commit but still getting the wrong color when using a named color. This makes this great library unusable if reading named color is not supported, or we have to manually replace the named color before parsing the svg... Thanks. |
Provided fix in fork, waiting for accepting pull request to origin |
Thanks for the update! Looks good with fill="none" (with the sample svg above). |
@ggua5470 I will test if named colors work at all. Fix provides solve only for transparent color, so I will test it on another svgs |
CSS named color "none" was not working properly because of the alpha channel this the color - it just not applied to the color, so you technically received "#000000" (black) instead of "#00000000" (transparent). What about another colors: I will check and provide screenshots if something would not work fine |
@rosoksdev It is crashing at Fillable.swift, on line 105: the colorComponents has only 2 values. ====== Updated 1 ====== ====== Updated 2 ====== |
@ggua5470 Thanks for the report, I will look at implementations and will notify you if something changes |
@ggua5470, I updated in latest commit, check if everything works |
@rosoksdev I did a quick test, it seems working now, at least for my limited use case ^_^ |
@ggua5470, great! Mention me if something will break again :D |
Same as #112
I am using the v2.3.2, and when a svg has fill="none" (e.g. the one below), it fills black color.
https://cdn.shopify.com/s/files/1/0496/1029/files/Freesample.svg
I have to add fill-opacity="0" to make it work.
The one without fill="none" works ok:
https://raw.githubusercontent.com/efc/SwiftSVG/master/SwiftSVGExamples/hawaiiFlowers.svg
The text was updated successfully, but these errors were encountered: