简体   繁体   English

iOS10 UIColor更改

[英]iOS10 UIColor Change

In Apple developer Document, I found something new in UIColor. 在Apple开发人员文档中,我在UIColor中找到了一些新东西。

If your app was linked on or after iOS 10 and when running on iOS 10 or later, colors are created in extended color spaces: 如果您的应用是在iOS 10或更高版本上链接的,并且在iOS 10或更高版本上运行时,则会在扩展颜色空间中创建颜色:

kCGColorSpaceExtendedGray kCGColorSpaceExtendedGray

kCGColorSpaceExtendedSRGB kCGColorSpaceExtendedSRGB

When working in an extended color space, color values are not clamped to fit inside the color gamut, meaning that component values may be less than 0.0 or greater than 1.0. 在扩展的色彩空间中工作时,颜色值不会被钳位以适合色域内部,这意味着组件值可能小于0.0或大于1.0。 When displayed on an sRGB display, such colors are outside the gamut and will not be rendered accurately. 当在sRGB显示器上显示时,此类颜色不在色域范围内,因此无法准确呈现。 However, extended color spaces are useful working color spaces when you want a pixel format and representation that other color spaces can be easily converted into. 但是,当您希望像素格式和表示形式可以轻松转换为其他色彩空间时,扩展色彩空间是有用的工作色彩空间。 For example, a color in the display P3 color space that is not within the sRGB color gamut can still be converted to an extended sRGB format. 例如,显示P3颜色空间中不在sRGB色域内的颜色仍可以转换为扩展的sRGB格式。 Some of its values will be outside of the 0.0 to 1.0 range. 其某些值将超出0.0到1.0范围。 However, when displayed on a device with a P3 display gamut, it would still be rendered correctly. 但是,当在具有P3显示色域的设备上显示时,它仍将正确呈现。

To summarize, when you need to worry about color spaces, use these extended color spaces as working color spacs. 总而言之,当您需要担心色彩空间时,请将这些扩展的色彩空间用作有效的色彩空间。 When you need to worry about representing that color as closely as possible in a specific color space, convert the color from the extended color space into the target color space. 当您需要担心在特定颜色空间中尽可能接近地表示该颜色时,请将颜色从扩展颜色空间转换为目标颜色空间。

I just can't understand that, and the debug areas showed UIExtendedGrayColorSpace 0 0 when I wanted to debug some view's background in Xcode8. 我只是不明白,当我想在Xcode8中调试某些视图的背景时,调试区域显示了UIExtendedGrayColorSpace 0 0。 So what color is that? 那是什么颜色

I am not 100% certain, but from what I have seen... 我不是100%肯定,但是从我所看到的...

UIExtendedGrayColorSpace 0 0 is "clear" and UIExtendedGrayColorSpace 1 1 is white. UIExtendedGrayColorSpace 0 0为“清除”, UIExtendedGrayColorSpace 1 1为白色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM