暗模式Gmail签名将PNG(光栅)图像颜色从黑色随机更改为白色



我有一个基于Gmail(网络应用程序(的电子邮件签名,服务器上托管着PNG图像(请参阅下面的代码(。我只是在更新这个签名以适应";"暗模式";突然,在谷歌Pixel 3a手机(显然是安卓系统(的Gmail应用程序中,自定义的Facebook PNG图标在黑暗模式下变成了白色(应该保持黑色(-请查看屏幕截图。后来领英的图标也变成了白色,尽管没有"暗模式";提供了代码,并且服务器上没有这些自定义图标的白色版本。

据我所知,没有办法改变光栅图像(PNG(的颜色。我很困惑。有什么魔术发生了吗?谷歌学会在黑暗模式下改变光栅图像的颜色了吗?我在网上找不到任何答案。请帮忙。

屏幕截图1:安卓Gmail应用程序-黑色图标

屏幕截图2:安卓Gmail应用程序-自定义Facebook图标变成白色

屏幕截图3:安卓Gmail应用程序-自定义Facebook和LinkedIn图标变成白色

<head>  

<style>

a[x-apple-data-detectors] {
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
a:any-link {
text-decoration: none !important;
}

body { font-family:Helvetica, Arial, sans-serif; font-size:80%; }

</style>

</head>
Regards,
<br><br>
Name Surname
<br><br>
<i>Title</i>
<br><br><br>
w: <a href="#" target="_blank" style="color:#000000; line-height:1.7em;">#</a>
<br>
<table cellpadding="1" cellspacing="0" border="0" style="line-height:2em;">
<tr>
<td>
<a href="#" title="FB" target="_blank"><img alt="Facebook" src="/email-images/fb-centered-60px.png" width="15" height="15" style="font-family: sans-serif; color:#010101; font-size:10px; display:block; border:0px;" border="0"></a>
</td>
<td>&nbsp;&nbsp;</td>
<td>
<a href="/michael" title="Instagram" target="_blank"><img alt="Instagram" src="/email-images/instagram-60px.png" width="15" height="15" style="font-family: sans-serif; color:#010101; font-size:10px; display:block; border:0px;" border="0"></a>
</td>
<td>&nbsp;&nbsp;</td>
<td>
<a href="#" title="LinkedIn" target="_blank"><img alt="LinkedIn" src="/email-images/linkedin-60px.png" width="15" height="15" style="font-family: sans-serif; color:#010101; font-size:10px; display:block; border:0px;" border="0"></a>
</td>
<td>&nbsp;&nbsp;</td>
<td>
<a href="#" title="YouTube" target="_blank"><img alt="YouTube" src="/email-images/youtube-60px.png" width="15" height="15" style="font-family: sans-serif; color:#010101; font-size:10px; display:block; border:0px;" border="0"></a>
</td>
<td>&nbsp;&nbsp;</td>
<td>
<a href="#" title="Amazon" target="_blank"><img alt="Amazon" src="/email-images/amazon-60px.png" width="15" height="15" style="font-family: sans-serif; color:#010101; font-size:10px; display:block; border:0px;" border="0"></a>
</td>
</tr>
</table>

<br><br>
<span style="font-size:x-small;">As featured in:</span>
<br><br>
<img alt="BBC Sky The Times Forbes The Telegraph The Observer" src="/email-images/michael-media-logos-980x50px.png" width="490" height="25" style="font-family: sans-serif; color:#000000; font-size:20px; display:block; border:0px;" border="0">
<br>
<div style="color:#000000; font-size:x-small;">Michael Ltd, Company Number 1111, VAT 1111, Registered office: <a href="#" style="text-decoration:none!important; color:#010101!important; border:none!important;" x-apple-data-detectors="false">33 Street, 43440, New York</a></div>
<br><br>

自2019年10月Gmail黑暗模式开始以来,这种情况一直在发生。但Gmail确定图像是否应该更改的启发式方法似乎因设备而异,并且因安卓系统和iOS系统而异。你可以在这里读到很多例子的讨论(包括著名的邪恶喇嘛的例子(。

我不确定你的确切问题是什么,但可以使用mix-blend-modefilter等属性在CSS中更改位图(如任何格式的图像:JPG、PNG、WebP…(。我不确定Gmail是如何做到这一点的,尽管在这里,这可能发生在他们的图像代理服务器的服务器端。

如果你想简单地了解这样的转换,你可以尝试Chrome的自动深色主题,自Chrome 96以来,Chrome DevTools中就提供了该主题(在三点菜单中,然后是渲染,然后是"模拟自动深色模式"选项(。

相关内容