{"id":21768108,"url":"https://github.com/below/svgsample","last_synced_at":"2026-05-19T06:37:13.450Z","repository":{"id":233273349,"uuid":"786413397","full_name":"below/SVGSample","owner":"below","description":"A sample to demonstrage an SVG color issue","archived":false,"fork":false,"pushed_at":"2024-04-14T18:28:24.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T05:43:58.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/below.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-14T11:44:49.000Z","updated_at":"2024-04-14T11:44:54.000Z","dependencies_parsed_at":"2024-04-15T10:47:42.317Z","dependency_job_id":"751151e2-9c37-45b1-980a-fbe6fcf18942","html_url":"https://github.com/below/SVGSample","commit_stats":null,"previous_names":["below/svgsample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/below/SVGSample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FSVGSample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FSVGSample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FSVGSample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FSVGSample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/below","download_url":"https://codeload.github.com/below/SVGSample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FSVGSample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33204730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"online","status_checked_at":"2026-05-19T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-26T13:33:35.502Z","updated_at":"2026-05-19T06:37:13.435Z","avatar_url":"https://github.com/below.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SVG Color Issue\n\nWhy do Xcode / iOS / macOS see colors in an SVG file differently than the Finder or Inkscape?\n\n## Primary Objective\n\nI wanted to create a dark mode image from an existing SVG using [Inkscape](https://inkscape.org), but apparently Xcode does not honor the color change (whereas the Finder does).\n\n## UPDATE:\n\nThere is a discussion about this on the [Inkscape Forums](https://inkscape.org/forums/questions/svgs-import-but-dont-display-correctlyfully/?c=70115#c70115).\n\n## The Setup\n\nI am using a simple image here as sample: ![A plus sign in dark grey](SVGSample/Assets.xcassets/plus.imageset/plus.svg)\n\nThen, using Inkscape, I colored this image green: ![A plus sign in green](SVGSample/Assets.xcassets/plus_green.imageset/plus_green.svg)\n\nNotice that your browser should be displaying this plus sign in green. The same goes for the Finder, when you look at the file in QuickLook. Further, these images are taken directly from the sample project.\n\nWhen you open the sample project and look at the assets, you will notice that the images look identical:\n\n![Plus Signs in Xcode Asset catalog, both dark grey](images/assets.png)\n\nThis does not change when inspecting the images in a preview canvas, or running the app on a platform of your choice.\n\n## Who is the culprit?\n\nInspecting the original [plus.svg](SVGSample/Assets.xcassets/plus.imageset/plus.svg#L2), we can see that the color is specified as `fill=\"#262626\"`. In the [plus_green.svg](SVGSample/Assets.xcassets/plus_green.imageset/plus_green.svg#L39) which has been added using Inkscape, this attribute is still present, and new attributes have been added:\n```\n     fill=\"#262626\"\n     id=\"path1\"\n     style=\"fill:#008000\" /\u003e\n```\n\nApparently, Xcode, iOS and macOS still use the `fill` attribute, whereas Safari and the Finder will use the `style` attribute.\n\nMy knowledge of svg markup is limited, so I have no idea who is responsible. Here is my list of suspects so far:\n\n* **Inkscape**, because it is not setting the color correctly\n* **Xcode and Apple SDKs** because it is not reading the `stlye` attribute\n* **The original image**, because it indroduced an outdated atttribute\n\nThe original file does not specify an svg version, and I have no idea how it was exported or created. In this trivial example I could remote the `fill` attribute, or change it accordingly. In my real app, the images are much more complex, and I would rather just have Xcode use the colors which I have set in Inkscape.\n\nIf you have any idea what the issue is, or if there is a feature in Inkscape that will produce a file which is read correctly by Xcode and the SDKs, please let me know.\n\n## Afterthoughts\n\nThis seems to be another issue where different part of the Apple OS uses a different renderer for the same thing, an issue I first discorverd with MP3s. Then I found at least four different decoders in various parts of macOS and Apple apps, which I could tell because each of them would play a different kind of non-standard MP3s.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelow%2Fsvgsample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbelow%2Fsvgsample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelow%2Fsvgsample/lists"}