Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Fixed colorWithFlatVersionFrom: sets colors with alpha = 0 #69

Merged
merged 4 commits into from
Oct 9, 2015

Conversation

wimbledon
Copy link
Contributor

Closes #70

@bre7
Copy link
Collaborator

bre7 commented Oct 8, 2015

It doesn't set the alpha to 0, it get's the color's current alpha and computes a flat color taking said value into account instead of a hardcoded 1 (Similar to #50)

@wimbledon
Copy link
Contributor Author

The problem is that it returns alpha==0.0f when I pass in a flatColor (i.e. FlatBlue) to [color getLightness:nil valueForA:nil valueForB:nil alpha:&colorAlpha]; right now.
How would you recommend solving the bug #70?

@bre7
Copy link
Collaborator

bre7 commented Oct 8, 2015

[color getLightness:nil valueForA:nil valueForB:nil alpha:&colorAlpha];
colorAlpha = colorAlpha > 0 ? colorAlpha : 1.0;
return [[self class] colorWithFlatVersionOf:color withAlpha:colorAlpha];

@bre7
Copy link
Collaborator

bre7 commented Oct 9, 2015

Thanks

@ViccAlexander version bump ?

bre7 added a commit that referenced this pull request Oct 9, 2015
Fixed colorWithFlatVersionFrom: sets colors with alpha = 0
@bre7 bre7 merged commit 270002f into vicc:master Oct 9, 2015
@vicc
Copy link
Owner

vicc commented Oct 9, 2015

@bre7 Yup. Just bumped it up to 2.0.4.

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

Successfully merging this pull request may close these issues.

3 participants