CSS Chrome 呈现的颜色与 Safari 和 Firefox 不同
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6237455/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Chrome renders colours differently from Safari and Firefox
提问by Evgeny Shadchnev
Chrome renders #FF3A00 as #FF0000 for some reason. I included a screenshot from jsfiddleto illustrate the point. The colour that the Color Meter reports (and what I see) differs from what CSS says.
由于某种原因,Chrome 将 #FF3A00 呈现为 #FF0000。我包含了来自jsfiddle的屏幕截图来说明这一点。Color Meter 报告的颜色(以及我所看到的)与 CSS 所说的不同。
This happens to other colours too. For example, #FFAF00 is rendered as #FFA400 according to the Color Meter.
其他颜色也会发生这种情况。例如,根据色度计,#FFAF00 被渲染为#FFA400。
However, the colours are rendered without problems on Safari and Firefox. I'm on a Mac using Chrome 11, Safari 5 and Firefox 5.
但是,在 Safari 和 Firefox 上呈现颜色没有问题。我在 Mac 上使用 Chrome 11、Safari 5 和 Firefox 5。
I'm sure there's a logical explanation. Any ideas?
我相信有一个合乎逻辑的解释。有任何想法吗?
Update: I'm attaching a screenshot of Chrome next to Safari showing the very same page. I checked this image in Photoshop: the colours are #F00 in Chrome and #FF3A00 in Safari.
更新:我在 Safari 旁边附上了 Chrome 的屏幕截图,显示了相同的页面。我在 Photoshop 中检查了这张图片:Chrome 中的颜色是 #F00,Safari 中的颜色是 #FF3A00。
采纳答案by Trevor Burnham
I recently posted a similar question: https://stackoverflow.com/questions/6338077/google-chrome-for-mac-css-colors-and-display-profiles
我最近发布了一个类似的问题:https: //stackoverflow.com/questions/6338077/google-chrome-for-mac-css-colors-and-display-profiles
As Andrew Marshall answered there, this is a known issue: http://code.google.com/p/chromium/issues/detail?id=44872
正如安德鲁马歇尔在那里回答的那样,这是一个已知问题:http: //code.google.com/p/chromium/issues/detail?id=44872
回答by Evgeny Shadchnev
Ok, as it turned out, I needed to restart my Chrome. I often connect my macbook air to a 24 inch monitor. It looks like Chrome displays the colours incorrectly when I change to a monitor that's different from what was used when Chrome was started.
好吧,事实证明,我需要重新启动我的 Chrome。我经常将我的 macbook air 连接到 24 英寸显示器。当我更改为与 Chrome 启动时使用的显示器不同的显示器时,Chrome 似乎显示的颜色不正确。
I found the answer on the Google Help forum: "I should mention that in OS X, every time you change your monitor or monitor profile (e.g. if you switch from your laptop display to your external display), you MUST restart Chrome for it to get the proper monitor profile information from the OS."
我在Google 帮助论坛上找到了答案:“我应该提到,在 OS X 中,每次更改显示器或显示器配置文件(例如,如果从笔记本电脑显示器切换到外接显示器),您都必须重新启动 Chrome从操作系统获取正确的显示器配置文件信息。”
回答by Lindoélio Lázaro
By default both Firefox and Safari use the sRGB color profile. You must do the same, if your Google Chrome takes a different color profile as default.
默认情况下,Firefox 和 Safari 都使用 sRGB 颜色配置文件。如果您的谷歌浏览器默认采用不同的颜色配置文件,您也必须这样做。
- Access at Chrome: chrome://flags/#force-color-profile
- Change Force color profileto "sRGB".
- Relaunch your browserand testify the rendered colors now.
- 在 Chrome 上访问:chrome://flags/#force-color-profile
- 将Force 颜色配置文件更改为“ sRGB”。
- 现在重新启动浏览器并验证渲染的颜色。
回答by artificialidiot
Mac has color correction set up for your monitor. Your browser may or may not use color correction for web content/images depending on its setup. Your color picker reports what your OS thinks it is rendering. Your browser may report something else.
Mac 为您的显示器设置了色彩校正。您的浏览器可能会或可能不会对网络内容/图像使用色彩校正,具体取决于其设置。您的颜色选择器报告您的操作系统认为它正在呈现的内容。您的浏览器可能会报告其他内容。
Color on computers. Something many of us take for granted but never bothered to understand how it is rendered.
电脑上的颜色。我们中的许多人认为理所当然,但从不费心去理解它是如何呈现的。
回答by Muthukrishnan
Chrome color picker works by taking color from current monitor color profile,and the problem may happens by changing color setting or sometime change monitor, please check the below method to solve.
Chrome 颜色选择器的工作原理是从当前显示器颜色配置文件中获取颜色,更改颜色设置或有时更换显示器可能会出现问题,请检查以下方法来解决。
Go to chrome://flags/#force-color-profile and click Reset all to default
转到 chrome://flags/#force-color-profile 并单击全部重置为默认值
Thanks.
谢谢。
回答by newfivefour
I changed the Colour Profile in OS X and that sorted it for me.
我更改了 OS X 中的颜色配置文件,并为我进行了排序。
See the screenshots below using different Color Profile. Note, in the screenshots I'm trying to differentiate between #ff00ff
, #ff1aff
, #ff33ff
and #ff4dff
. It's only when I don't choose the default OS X colour profile that I can differentiate the colours correctly.
请参阅下面使用不同颜色配置文件的屏幕截图。请注意,在截图我试图区分#ff00ff
,#ff1aff
,#ff33ff
和#ff4dff
。只有当我不选择默认的 OS X 颜色配置文件时,我才能正确区分颜色。
Default colour profile:
默认颜色配置文件:
With a different colour profile:
使用不同的颜色配置文件:
来自:OS X 上的 CSS 颜色在 Firefox 中正确显示,但在 Safari 和 Chrome 中显示不正确(可能“已解决”)
I found Safari and Chrome could not differentiate between #ff00ff
, #ff1aff
, #ff33ff
and #ff4dff
. But Firefox could. In addition Inkscape, an X11 app, could. But Gimp and Libreoffice Writer, non X11 apps, could not. Firefox and X11 apps seem to be using their own colour profile somehow.
我发现,Safari和Chrome浏览器无法区分#ff00ff
,#ff1aff
,#ff33ff
和#ff4dff
。但 Firefox 可以。此外,X11 应用程序 Inkscape 可以。但是 Gimp 和 Libreoffice Writer,非 X11 应用程序,不能。Firefox 和 X11 应用程序似乎以某种方式使用了自己的颜色配置文件。
I have no idea why Mac defaults to Color LCD
profile which does not do this differentiation amongst others.
我不知道为什么 Mac 默认使用Color LCD
配置文件,而这与其他配置文件没有区别。
回答by Zar
Had this problem with Chrome (Lubuntu) when exporting a PNG in Photoshop. Solution: File -> Save As -> Uncheck "ICC Profile: Adobe RGB (1998)".
在 Photoshop 中导出 PNG 时,Chrome (Lubuntu) 遇到了这个问题。解决方案:文件 -> 另存为 -> 取消选中“ ICC 配置文件:Adobe RGB (1998)”。