我用jQuery获得了颜色值.css('color'),然后我知道它应该是颜色.
如何比较从jQuery获得的颜色值,例如黑色值?
我正在尝试获取rgb字符串的各个值.我一直在接近,但我只是撞墙了.我想做这样的事情:
var color = rgb(255, 85, 120);
/// My Regex ///
var rRegex = /^rgb\(\d{3}/; // Which actually gives me an array of two strings...ugh
var gRegex = ;
var bRegex = ;
var r = color.match(rRegex);
var g = color.match(gRegex);
var b = color.match(bRegex);
Run Code Online (Sandbox Code Playgroud)
我只是想:
/// // I think I can pull these off by Starts With and Ends With anchors... ///
r = 'From "(" to "," ';
g = 'From "," to "," ';
b = 'From …Run Code Online (Sandbox Code Playgroud)