https://github.com/below/darkuikit
How can I best create a dark mode image for a UIButton — with an svg file?
https://github.com/below/darkuikit
Last synced: 8 months ago
JSON representation
How can I best create a dark mode image for a UIButton — with an svg file?
- Host: GitHub
- URL: https://github.com/below/darkuikit
- Owner: below
- Created: 2024-01-28T23:13:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-01T09:21:43.000Z (about 2 years ago)
- Last Synced: 2025-03-21T05:43:52.052Z (about 1 year ago)
- Language: Swift
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DarkUIKit
## Update: Fixed
The issue could simply be fixed by setting all assets to "Render As Template Image"
## Prime Objective
The prime objective is to have a UIButton with an image that supports dark mode.
## What I have tried so far
* Created an image asset with a differently colored (and, for debugging purposes, differently shaped) image for the dark appearance
* Created a color asset, and assigned it to the `UIButton`
None of these things work. While the icon is obviously changed, its color remains black, even in dark mode.
The color seems to have no effect on the image, even when the asset is set to "Render as Template"
## Any ideas?
Do you have any ideas to have an image that supports dark mode? Is PDF the solution? Or, gasp, png?