用variablesiOS更改背景颜色

我想用variables来改变标签的背景颜色,我该怎么做?

这是我的代码,但我想有一个variables,而不是'redColor'

[publisherLabel setBackgroundColor:[UIColor redColor]]; 

用RGBA值的颜色variables。

 UIColor *myColor = [UIColor colorWithRed:100.0/255.0 green:101.0/255.0 blue:102.0/255.0 alpha:1.0]]; 

如果你愿意,你也可以使用HEX:

 #define HEXCOLOR(c) [UIColor colorWithRed:((c>>24)&0xFF)/255.0 green:((c>>16)&0xFF)/255.0 blue:((c>>8)&0xFF)/255.0 alpha:((c)&0xFF)/255.0]; // usage: UIColor* c = HEXCOLOR(0xff00ffff);