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

Fix: Alpha component error #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Source/KxMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,12 @@ - (void)drawBackground:(CGRect)frame
{
CGFloat R0 = 0.267, G0 = 0.303, B0 = 0.335;
CGFloat R1 = 0.040, G1 = 0.040, B1 = 0.040;
CGFloat alpha;

UIColor *tintColor = [KxMenu tintColor];
if (tintColor) {

CGFloat a;
[tintColor getRed:&R0 green:&G0 blue:&B0 alpha:&a];
[tintColor getRed:&R0 green:&G0 blue:&B0 alpha:&alpha];
}

CGFloat X0 = frame.origin.x;
Expand Down Expand Up @@ -659,7 +659,7 @@ - (void)drawBackground:(CGRect)frame
[arrowPath addLineToPoint: (CGPoint){arrowX0, arrowY1}];
[arrowPath addLineToPoint: (CGPoint){arrowXM, arrowY0}];

[[UIColor colorWithRed:R0 green:G0 blue:B0 alpha:1] set];
[[UIColor colorWithRed:R0 green:G0 blue:B0 alpha:alpha] set];

Y0 += kArrowSize;

Expand All @@ -676,7 +676,7 @@ - (void)drawBackground:(CGRect)frame
[arrowPath addLineToPoint: (CGPoint){arrowX0, arrowY0}];
[arrowPath addLineToPoint: (CGPoint){arrowXM, arrowY1}];

[[UIColor colorWithRed:R1 green:G1 blue:B1 alpha:1] set];
[[UIColor colorWithRed:R1 green:G1 blue:B1 alpha:alpha] set];

Y1 -= kArrowSize;

Expand All @@ -693,7 +693,7 @@ - (void)drawBackground:(CGRect)frame
[arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY1}];
[arrowPath addLineToPoint: (CGPoint){arrowX0, arrowYM}];

[[UIColor colorWithRed:R0 green:G0 blue:B0 alpha:1] set];
[[UIColor colorWithRed:R0 green:G0 blue:B0 alpha:alpha] set];

X0 += kArrowSize;

Expand All @@ -710,7 +710,7 @@ - (void)drawBackground:(CGRect)frame
[arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY1}];
[arrowPath addLineToPoint: (CGPoint){arrowX0, arrowYM}];

[[UIColor colorWithRed:R1 green:G1 blue:B1 alpha:1] set];
[[UIColor colorWithRed:R1 green:G1 blue:B1 alpha:alpha] set];

X1 -= kArrowSize;
}
Expand All @@ -726,8 +726,8 @@ - (void)drawBackground:(CGRect)frame

const CGFloat locations[] = {0, 1};
const CGFloat components[] = {
R0, G0, B0, 1,
R1, G1, B1, 1,
R0, G0, B0, alpha,
R1, G1, B1, alpha,
};

CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
Expand Down