colors.js refactor.
This commit is contained in:
parent
188561c9ca
commit
f59f7dc0e0
|
@ -14,15 +14,10 @@ exports.matchColor = function(col) {
|
|||
return exports._cache[col];
|
||||
}
|
||||
|
||||
var rgb = function(col) {
|
||||
var col = parseInt(col.substring(1), 16);
|
||||
return [(col >> 16) & 0xff, (col >> 8) & 0xff, col & 0xff];
|
||||
};
|
||||
|
||||
var col_ = rgb(col)
|
||||
, r = col_[0]
|
||||
, g = col_[1]
|
||||
, b = col_[2]
|
||||
var col_ = parseInt(col.substring(1), 16)
|
||||
, r = (col_ >> 16) & 0xff
|
||||
, g = (col_ >> 8) & 0xff
|
||||
, b = col_ & 0xff
|
||||
, ldiff = Infinity
|
||||
, li = -1
|
||||
, i = 0
|
||||
|
|
Loading…
Reference in New Issue