Interface Builder中的颜色错误 [英] Wrong color in Interface Builder

查看:139
本文介绍了Interface Builder中的颜色错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很抱歉我的英语不好)

I'm so sorry for my bad english)

问题:我在Interface Builder颜色中设置了RGB,然后我做一个工作窗口的截图,在Photoshop中打开它,并通过颜色选择器检查颜色,我在Interface Builder中设置。结果 - RGB值与我设置的值不同。

The problem: I set in Interface Builder color, setting the channels RGB, then I do a screenshot of the working window, open it in Photoshop and check color by color picker, which I have set in Interface Builder. The result - the RGB values ​​are different from the ones I set.

视频:(建议在全屏720p中观看):
http://www.youtube.com/watch?v=ASLfnYHPbqM

Video: (recommended watch in the Full screen 720p): http://www.youtube.com/watch?v=ASLfnYHPbqM

最常见的异常从第45秒开始,当我试图使用Interface Builder的颜色选择器。它显示RGB值不同于我在他的相同和安装),但Ñ选择器IB的值与颜色选择器Photoshop的值一致。

Most abnormal begins with the 45th second, when I tried to use the color picker of the Interface Builder. It shows the RGB values ​​are different from those that I have in him the same and installed), but the values ​​of сolor picker IB coincide with the values ​​of color picker Photoshop.

推荐答案

苹果认为,无论何处,颜色看起来都一样,更重要的是,颜色在任何地方都具有相同的RGB值。看到,相同的RGB值在不同的屏幕上看起来不一样,因为每个屏幕都有不同的显示特性。

Apple thinks it is much more important that colors look the same everywhere than that colors have the same RGB values everywhere. See, the same RGB values will not look the same on different screens, because every screen has different display characteristics.

因此,当你截取屏幕截图时,苹果不仅仅为图像中的每个像素存储一个RGB值,它们还将显示器的显示特性存储在图像文件中。这有什么好处?如果有人打开您的屏幕截图,系统可以查看创建它的人的监视器特性,将它们与想要观看它的人的监视器的监视器特性进行比较,然后可以计算如何必须采用图像中的RGB值,以使图像在电流监视器上看起来相同。如果它只是显示RGB值而没有做任何这些,图像颜色可能看起来错误(在某些情况下只是轻微,在某些情况下更多,如果用户有一个非常糟糕的监视器,在某些情况下甚至彻底错误) 。

So when you take a screenshot, Apple does not just store a RGB value for every pixel in the image, they also store the display characteristics of your monitor inside the image file. What is that good for? If someone else opens your screenshot, the system can look at the monitor characteristics of the person who created it, compare those to the monitor characteristics of the monitor of the person that wants to watch it, and can then calculate how it must adopt the RGB values in the image so that the image looks the same on the current monitor. If it was just displaying the RGB values without doing any of this, the image colors may look wrong (in some cases only slightly, in some cases some more, and if the user has a very bad monitor, in some cases even radically wrong).

因此,系统向图形适配器发送不同的RGB值,因为RGB颜色本身并不真正描述颜色。 RGB值与监视器配置文件一起描述颜色,而不是RGB值很重要,颜色很重要。如果我做一些红色,我希望它在每个显示器上是相同的红色。我不希望它在一个显示器上是一个较暗的红色,在另一个显示器上是一个较浅的红色,而在第三个显示器上是一个几乎是粉红色的红色。

So the system send different RGB values to the graphics adapter, because RGB colors by themselves do not really describe a color. RGB values together with a monitor profile do describe a color and not the RGB values are important, the color is important. If I make something red, I want it to be the same shade of red on every monitor. I don't want it to be a darker red on one monitor, a lighter red on another monitor, and a red that is almost pink on a third monitor.

Photoshop的问题是它有自己的内置颜色校正机制。 Photoshop通常工作在sRGB(标准RGB色彩空间)或Adobe RGB(Adobe发明的扩展色彩空间)。加载不在所需颜色空间内的图像时,Photoshop将转换图像的颜色空间,每个颜色空间转换都会导致RGB值发生变化。请注意,Photoshop中显示的图像仍然根据您当前的显示器颜色特性进行颜色校正,它只是您在Photoshop中操作的RGB值在另一个颜色空间,并且存储回文件时,Photoshop会将值转换回或它会保留它们并将一个新的颜色配置文件嵌入到图像文件中。

The problem with Photoshop is that it has its own build-in color correction mechanism. Photoshop usually works in sRGB (standard RGB color space) or Adobe RGB (an extended color space Adobe invented). When you load an image that is not within the desired color space, Photoshop will transform the color space of the image and every color space transform causes the RGB values to change. Please note that the images displayed within Photoshop are still color corrected according to your current monitor color characteristics, it's just the RGB values you manipulate within Photoshop that are in another color space and when stored back to file, Photoshop will either transform the values back or it will keep them and embed a new color profile into the image file.

RGB单独用于描述颜色的次数已经存在多年了。今天,RGB是相当无意义的,只有结合一个颜色配置文件,它变得真正有意义的描述一个实际的颜色。

The times where RGB alone has been used to describe colors are over for many years already. Today RGB is rather meaningless on its own, only when combined with a color profile it becomes really meaningful in describing an actual color.

如果你想要一个截图没有真正的颜色个人资料嵌入,请执行以下操作:

If you want a screenshot without a real color profile embedded, do the following:


  1. 打开系统偏好设置

  2. 转到颜色
  3. 选择常规RGB配置文件

  4. >
  5. 更改您的个人资料
  6. 更改个人资料
  1. Open "System Preferences"
  2. Go to "Displays"
  3. Go to "Color"
  4. Select "Generic RGB Profile"
  5. Make your screenshot
  6. Change your profile back

在更改个人资料之前可能需要先退出Xcode重新启动它后,你改变它),因为我不知道更改配置文件是否立即生效。它肯定会立即生效,如何在显示器上显示,但如果你想通过选择特定的RGB值在Xcode中选择一种颜色,我不知道一个配置文件更改是否会立即生效在这里(你可以给它

It may be necessary to quit Xcode first before you change the profile (and restart it after you changed it back), since I'm not sure if changing the profile has immediate effect. It certainly has immediate effect how things are displayed on your monitor, but if you want to choose a color in Xcode by selecting specific RGB values, I'm not sure if a profile change will have immediate effect here as well (you can give it a try without restarting, if that does not work, you must repeat it with restarting).

这可能会导致Photoshop中的颜色不正确,因为Photoshop可能仍然会转换颜色到sRGB或Adobe RGB。因此,您可能需要选择sRGB配置文件(具体取决于您的OS X版本,也可能命名为sRGB IEC61966-2.1),而不是选择Generic RGB配置文件。这样图像已经在sRGB颜色空间。你只需要说服Photoshop保持这种方式(而不是将其转换为Adobe RGB),然后你会真正看到相同的RGB值在Xcode和Photoshop。

This may still cause incorrect colors in Photoshop though, since Photoshop may still convert the colors to sRGB or Adobe RGB. So instead of selecting "Generic RGB Profile", you may want to select the "sRGB" profile (depending on your OS X version, may also be named "sRGB IEC61966-2.1"). This way the image is already in sRGB color space. You only have to convince Photoshop to keep it that way (and not converting it to Adobe RGB) and then you will really see the same RGB values in Xcode and Photoshop.

注意改变颜色配置文件如何使显示看起来不同?你认为颜色的变化是显着的?相信我,这是什么比不同的监视器,有时可以改变颜色。也许你现在可以理解为什么颜色校正是如此重要。所以问题是,为什么RGB值如此重要你首先?是否真的很重要,RGB值是否相同,只要显示的颜色是相同的?

Note how changing the color profile makes your display look quite differently? You think the color change is dramatically? Trust me, that is nothing compared to how different monitors may sometimes change the colors. Maybe you can now understand why color correction is so important. So the question is, why are the RGB values so important to you in the first place? Does it really matters, that RGB values are the same, as long as the displayed color is the same?

这篇关于Interface Builder中的颜色错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆