int red = 51;
int green = 255;
int blue = 51;
int alpha = 128;
NSString *htmlColor = [NSString
stringWithFormat:@"#%02X%02X%02X",
red, green, blue];
//htmlColor is #33FF33
//with transparency
htmlColor = [NSString
stringWithFormat:@"#%02X%02X%02X%02X",
red, green, blue, alpha];
//htmlColor is #33FF3380