大佬教程收集整理的这篇文章主要介绍了objective-c – iOS彩虹阵列,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
rainbowColors = [[NSArray alloc] initWithObjects: [UIColor colorWithRed:1 green:0 blue:0 alpha:1],[UIColor colorWithRed:1 green:0.25 blue:0 alpha:1],[UIColor colorWithRed:1 green:0.5 blue:0 alpha:1],[UIColor colorWithRed:1 green:0.75 blue:0 alpha:1],[UIColor colorWithRed:1 green:1 blue:0 alpha:1],[UIColor colorWithRed:0.75 green:1 blue:0 alpha:1],[UIColor colorWithRed:0.5 green:1 blue:0 alpha:1],[UIColor colorWithRed:0.25 green:1 blue:0 alpha:1],[UIColor colorWithRed:0 green:1 blue:0 alpha:1],[UIColor colorWithRed:0 green:1 blue:0.25 alpha:1],[UIColor colorWithRed:0 green:1 blue:0.5 alpha:1],[UIColor colorWithRed:0 green:1 blue:0.75 alpha:1],[UIColor colorWithRed:0 green:1 blue:1 alpha:1],[UIColor colorWithRed:0 green:0.75 blue:1 alpha:1],[UIColor colorWithRed:0 green:0.5 blue:1 alpha:1],[UIColor colorWithRed:0 green:0.25 blue:1 alpha:1],[UIColor colorWithRed:0 green:0 blue:1 alpha:1],[UIColor colorWithRed:0.25 green:0 blue:1 alpha:1],[UIColor colorWithRed:0.5 green:0 blue:1 alpha:1],[UIColor colorWithRed:0.75 green:0 blue:1 alpha:1],[UIColor colorWithRed:1 green:0 blue:1 alpha:1],[UIColor colorWithRed:1 green:0 blue:0.75 alpha:1],[UIColor colorWithRed:1 green:0 blue:0.5 alpha:1],[UIColor colorWithRed:1 green:0 blue:0.25 alpha:1],nil];
NSMutableArray *colors = [NSMutableArray array]; float INCREMENT = 0.05; for (float hue = 0.0; hue < 1.0; hue += INCREMENT) { UIColor *color = [UIColor colorWithHue:hue saturation:1.0 brightness:1.0 alpha:1.0]; [colors addObject:color]; }
这可以让您改变色调(或颜色),而不会改变屏幕上颜色的亮度,现在您很有可能无法保存.写得更简单,对于后来的读者来说也更加清晰.
以上是大佬教程为你收集整理的objective-c – iOS彩虹阵列全部内容,希望文章能够帮你解决objective-c – iOS彩虹阵列所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。