【发布时间】:2012-01-24 23:34:57
【问题描述】:
我正在做这样的事情:
- (NSArray*)colors {
float divisor = .3333;
NSMutableArray *retVal = [NSMutableArray array];
for (float one=0; one <= 1.0f; one += divisor) {
for (float two = 0; two <= 1.0f; two += divisor) {
for (float three = 0; three <= 1.0f; three += divisor) {
UIColor *color = [UIColor colorWithRed:one green:two blue:three alpha:.5];
// also bad
// UIColor *color = [UIColor colorWithHue:one saturation:two brightness:three alpha:.5];
[retVal addObject:color];
}
}
}
return retVal;
}
而且,正如我所怀疑的那样,颜色非常混乱(在眼睛看来)。红不配红,紫不配紫等。
有没有简单的方法可以创建一个不同颜色的列表,根据人类标准很好地分组,例如“看起来是蓝色的”?
【问题讨论】:
-
不,你应该这样回答:)
标签: objective-c ios color-palette