Skip to content

Commit c5ca9dc

Browse files
committed
Merge pull request #2 from jrapoport/parse-grayscale-colors
support white colorspace format
2 parents f41b635 + 35acdac commit c5ca9dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

AWLThemeManager/AWLThemeManager.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ - (UIColor*)colorFromString:(NSString*)colorValue
9898
{
9999
if ([self isValidString:colorValue]) {
100100
NSArray* array = [colorValue componentsSeparatedByString:@","];
101-
if (array && [array count] == 4) {
101+
if (array && [array count] == 2) {
102+
return [UIColor colorWithWhite:[array[0] floatValue]
103+
alpha:[array[1] floatValue]];
104+
}
105+
else if (array && [array count] == 4) {
102106
return [UIColor colorWithRed:[array[0] floatValue]/255
103107
green:[array[1] floatValue]/255
104108
blue:[array[2] floatValue]/255

0 commit comments

Comments
 (0)