Skip to content
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

Apply a gradient to a UIImage seems broken #23

Open
carole-lavillonniere opened this issue Oct 10, 2016 · 1 comment
Open

Apply a gradient to a UIImage seems broken #23

carole-lavillonniere opened this issue Oct 10, 2016 · 1 comment

Comments

@carole-lavillonniere
Copy link

carole-lavillonniere commented Oct 10, 2016

When applying this gradient to UIImages:

image.apply(gradientColors: [UIColor.yellow, UIColor.red], locations: [1.0, 0.0])

I would expect the whole image to be covered by the gradient since the colors are completely opaque.

However, it does sometimes seem to apply a strange blend mode, although the blend mode is left to the default value (CGBlendMode.normal).

See on the following example: the gradient is wrong on the 1st image, but correct on the 2nd image.

screenshot 2016-10-10 16 40 23

Here is a second example with the following gradient:

image.apply(gradientColors: [UIColor.black, UIColor.black], locations: [1, 0])

The 1st image is correct but the 2nd seems to be a negative.

screenshot 2016-10-10 16 48 04

I am using ImageHelper.swift and ImageVIewExtension.swift from master (24581b1)

@carole-lavillonniere
Copy link
Author

Not sure what the line 114 of ImageHelper.swift is for, but removing it fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant