-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ColorsFromImage returns white only #89
Comments
@Sittenstrolch I just tried it on the following image and it worked fine. Can you post your code so I can see what you're doing? I added my code below, including the image I used. self.imageView.image = [UIImage imageNamed:@"lambo.jpg"];
NSArray *colors = [NSArray arrayOfColorsFromImage:self.imageView.image withFlatScheme:NO];
self.view1.backgroundColor = colors[0];
self.view2.backgroundColor = colors[1];
self.view3.backgroundColor = colors[2];
self.view4.backgroundColor = colors[3];
self.view5.backgroundColor = colors[4]; |
@ViccAlexander I think the main difference is that im using swift2. I'm fetching the images from a url and pass them into a callback function. The images are displayed correctly and the average Color also works fine. But the ColorsFromImage returns white only. This is how I integrated your Pod into my Project: pod 'ChameleonFramework/Swift' My Code:
I tried to call the function with true and false as second parameter, but it made no difference. And the output is:
|
@Sittenstrolch Could you try the same example in both objc and swift ? This shouldn't be the issue since swift functions are only shorthands |
I honestly don't really know how to use objective-c within my swift project. Have you tried it with swift? |
My bad ✋ Fixed it... Thanks for the report @Sittenstrolch, try using Flat / Non-flat |
@bre7 Gotcha. @Sittenstrolch Chameleon |
Great! It works ;) |
Hello,
the above function does not work on a given image, neither with both true and false for the parameter isFlatScheme. The AverageColor function works fine on the same image.
What could lead to this problem?
The text was updated successfully, but these errors were encountered: