Skip to content

Commit

Permalink
fix(ios): have Ti.Color hex be AARRGGBB format (not RRGGBBAA)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Jul 6, 2020
1 parent cfbe324 commit 9c3321b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion iphone/TitaniumKit/TitaniumKit/Sources/API/TiUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,10 @@ + (NSString *)hexColorValue:(UIColor *)color
return @"#000000";
}
if (lroundf(alpha * 255.0) != 255) {
return [NSString stringWithFormat:@"#%02lX%02lX%02lX%02lX", lroundf(red * 255.0), lroundf(green * 255.0), lroundf(blue * 255.0), lroundf(alpha * 255.0)];
// AARRGGBB
return [NSString stringWithFormat:@"#%02lX%02lX%02lX%02lX", lroundf(alpha * 255.0), lroundf(red * 255.0), lroundf(green * 255.0), lroundf(blue * 255.0)];
}
// RRGGBB
return [NSString stringWithFormat:@"#%02lX%02lX%02lX", lroundf(red * 255.0), lroundf(green * 255.0), lroundf(blue * 255.0)];
}

Expand Down

0 comments on commit 9c3321b

Please sign in to comment.