-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow full color tinting on grayscale template images. #1629
Allow full color tinting on grayscale template images. #1629
Conversation
@jessietea - Can we add a grayscale template image in the test resources directory? https://github.com/TextureGroup/Texture/tree/master/Tests/TestResources Then we can have a new snapshot test that tints that asset with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test! This looks good to merge.
@Adlai-Holler - If you have any feedback on things we should change here please let us know and we'll put up a follow-up diff
@nguyenhuy - it seems like this is stuck on waiting for Danger to report back. is there any way to get past this? |
@rahul-malik Danger stopped working because we removed the BuildKite integration. I’m trying to fix it by running Danger with GitHub Actions (#1635). |
@rahul-malik Danger is back up now. |
Merge remote-tracking branch 'tensor/master' into template-image-tint-fix
…1629) * Allow full color tinting on grayscale template images. * Signing a commit with the correct email address. * Add snapshot test for a grayscale image with ASExperimentalDrawingGlobal enabled.
As part of #1629, we use the preferred or default UIGraphicsRendererFormat. This was pointing to a static variable which content scale was mutated across several graphic render passes and lead to pixelated views.
* Fix issue where UIGraphicsRendererFormat is mutated As part of #1629, we use the preferred or default UIGraphicsRendererFormat. This was pointing to a static variable which content scale was mutated across several graphic render passes and lead to pixelated views. * Update reference images with iOS 10.3
As an optimization,
imageRendererFormat
decides on a color space based on the image. Since template images are meant to be black and transparent, this means they are assigned a grayscale color space. This is not ideal, because a template image should be able to be tinted to any color, not just grayscale. In order to allow this, we can simply use the defaultUIGraphicsImageRendererFormat
if the image is a template image.