Authored by Justin R. Miller

properly handle dimming tint color (white color space, not RGB)

@@ -118,11 +118,17 @@ @@ -118,11 +118,17 @@
118 118
119 if (color) 119 if (color)
120 { 120 {
121 - CGFloat red, green, blue, alpha; 121 + CGFloat white, red, green, blue, alpha;
122 122
123 if ([color getRed:&red green:&green blue:&blue alpha:&alpha]) 123 if ([color getRed:&red green:&green blue:&blue alpha:&alpha])
  124 + {
124 colorHex = [NSString stringWithFormat:@"%02x%02x%02x", (NSUInteger)(red * 255), (NSUInteger)(green * 255), (NSUInteger)(blue * 255)]; 125 colorHex = [NSString stringWithFormat:@"%02x%02x%02x", (NSUInteger)(red * 255), (NSUInteger)(green * 255), (NSUInteger)(blue * 255)];
125 } 126 }
  127 + else if ([color getWhite:&white alpha:&alpha])
  128 + {
  129 + colorHex = [NSString stringWithFormat:@"%02x%02x%02x", (NSUInteger)(white * 255), (NSUInteger)(white * 255), (NSUInteger)(white * 255)];
  130 + }
  131 + }
126 132
127 return [self initWithMapBoxMarkerImage:symbolName tintColorHex:colorHex sizeString:sizeString]; 133 return [self initWithMapBoxMarkerImage:symbolName tintColorHex:colorHex sizeString:sizeString];
128 } 134 }