BonMot
BonMot copied to clipboard
Update image tinting to use UIGraphicsImageRenderer where possible
UIGraphicsImageRenderer
supports wide color, and UIGraphicsBeginImageContext
does not. We should use the former on OSes that support it.
Questions:
- does macOS have an equivalent image renderer?
- We currently have a convoluted image tinting function with a lot of conditional compilation. Can we imrprove this situation? Will we need to, in order to add a third or possibly fourth permutation of how we render?
Hi,
I've actually been using your library for a while now. Great work btw.
I came across this Issue and thought you might be interested in my port: https://github.com/shaps80/GraphicsRenderer
It's backward compatible & supports macOS. I don't think I've updated it to support wide colour, but that shouldn't be a huge task. Its also been designed to map the APIs directly, I was originally using it and then just dropping the prefix once I no longer needed it.
Anyway, maybe it's useful as a starting point.
@shaps80 thanks for sharing! I'll check it out if/when I get around to implementing this change.