Fix one bug of `sd_colorAtPoint:`, which set the alpha value default to 255, which should be 1
This commit is contained in:
parent
feed2e5abd
commit
46bf112de5
|
@ -60,7 +60,7 @@ static inline UIColor * SDGetColorFromPixel(Pixel_8888 pixel, CGBitmapInfo bitma
|
|||
// Get alpha info, byteOrder info
|
||||
CGImageAlphaInfo alphaInfo = bitmapInfo & kCGBitmapAlphaInfoMask;
|
||||
CGBitmapInfo byteOrderInfo = bitmapInfo & kCGBitmapByteOrderMask;
|
||||
CGFloat r = 0, g = 0, b = 0, a = 255.0;
|
||||
CGFloat r = 0, g = 0, b = 0, a = 1;
|
||||
|
||||
BOOL byteOrderNormal = NO;
|
||||
switch (byteOrderInfo) {
|
||||
|
@ -153,7 +153,7 @@ static inline UIColor * SDGetColorFromPixel(Pixel_8888 pixel, CGBitmapInfo bitma
|
|||
break;
|
||||
case kCGImageAlphaOnly: {
|
||||
// A
|
||||
a = pixel[0];
|
||||
a = pixel[0] / 255.0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue