简体   繁体   English

根据背景颜色更改链接颜色?

[英]Change link color based in background color?

Our white-background webpages use the blue hyperlinks as shown in the image below.我们的白色背景网页使用蓝色超链接,如下图所示。

Occasionally we have dash-bordered yellow information sections on a white webpage as shown.有时,我们会在白色网页上显示带有虚线边框的黄色信息部分,如图所示。 In that case someone said the blue hyperlink text was harder to see on their iPad, because there was not enough contrast between that blue and yellow.在那种情况下,有人说在他们的 iPad 上很难看到蓝色超链接文本,因为蓝色和黄色之间的对比度不够。

If white correlates with the blue shown, is there a color formula to calculate what a darker blue should be for that yellow background?如果白色与显示的蓝色相关,是否有颜色公式来计算黄色背景的深蓝色应该是多少?

在此处输入图像描述

I tried the following:我尝试了以下内容:

  1. Getting the % R GB difference from white to the blue获取 % R GB 从白色到蓝色的差异

  2. Applying the % to the yellow.将 % 应用于黄色。

Result:结果:

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

By the way, this is with CSS mix-blend-mode: darken;顺便说一下,这是 CSS mix-blend-mode: darken;

在此处输入图像描述

And there is another answer at:还有另一个答案:

https://ux.stackexchange.com/questions/144624/change-link-color-based-in-background-color/144627#144627 https://ux.stackexchange.com/questions/144624/change-link-color-based-in-background-color/144627#144627

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

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