Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一种直接的方法来从 RGB 转换颜色,从 Photoshop 等工具中获取它,然后将其转换为 UIColor。由于 UIColor 对每个颜色空间使用 0.0 到 1.0 的标准化色域,我不确定这是如何完成的。
感谢您的解决方案。
您的值介于 0 和 255 之间。使用它们创建 UIColor:
float r; float g; float b; float a; [UIColor colorWithRed:r/255.f green:g/255.f blue:b/255.f alpha:a/255.f];