Hex colors display differently between Chrome and Safari on Mac

后端 未结 1 1040
囚心锁ツ
囚心锁ツ 2021-01-06 15:44

Is it possible for a hexadecimal color value to be displayed differently between browsers? While working on a site, I kept noticing a difference in a red that I was using wh

1条回答
  •  被撕碎了的回忆
    2021-01-06 15:59

    This is because Safari has access to your monitor's ICC profile, and that it will use it to provide the best correspondence in sRGB.

    On mac, you can check it with the DigitalColor Meter utility you've got in you Apps > Utilities. Set it to Display in sRGB to see the colors measured. Safari will always display the correct sRGB color, while Chrome and Firefox will be off with an non standard sRGB color profile.

    If you set your monitor's color profile to an standard sRGB one, then all browsers will show the correct values.

    There is no setting in Safari to make it behave like others, and I didn't found a way in chrome either ; Firefox has some flags about color management, but I think it's only about images' embedded ICC profiles, not the monitor's one.

    [edit],

    Actually FF's flags gfx.color_management.XXXX do also apply to the rendered colors, and will provide the same behavior as Safari. But, it seems there are bugs when setting it (e.g canvas' getImageData() method will return the displayed sRGB values instead of the RGB ones that has been authored).

    0 讨论(0)
提交回复
热议问题