我试图通过动态设置文本颜色以匹配背景颜色来在颜色选择器中创建透明文本的错觉。 jquery的最后一行似乎有问题。 到目前为止,我所拥有的是: $(‘.color’).blur(function() { id = $(this).attr(‘id’); id = id.substring(0,id.length-6); $(id).css(‘color’,$(this).css(‘background-color’)); }); 和 …
使用JSColor,在用户选择颜色后,如何获得“hex”? $(“input#colorpicker”).css(‘background-color’) => this returns background-color: rgb(107, 132, 255); 但不是hex。