最佳答案
很简单,拿黄色和白色来说:
back_color = {r:255,g:255,b:255}; //white
text_color = {r:255,g:255,b:0}; //yellow
在上帝的地球上,什么样的物理定律使得黄色文字不能在白色背景下阅读,而蓝色文字可以?
为了我的可定制小部件,我尝试了所有可能的颜色模型,我找到了转换函数; 都不能说,绿色可以在白色和黄色不能,只是基于数字比较。
我查看了 Adsense (它是由所有互联网中的 Budda 创建的) ,猜猜他们做了什么,他们做了预置和彩色单元格距离计算。我做不到。我的用户有权选择即使是最炎症的视网膜,不美观的组合,只要文本仍然可以阅读。