Fix: _parse -> parseRGB
This commit is contained in:
parent
e3c3dcc1ff
commit
a3f26d89b8
|
@ -50,7 +50,7 @@ var usercss = (function () {
|
||||||
// https://bugs.webkit.org/show_bug.cgi?id=14563
|
// https://bugs.webkit.org/show_bug.cgi?id=14563
|
||||||
document.head.appendChild(el);
|
document.head.appendChild(el);
|
||||||
|
|
||||||
function _parse(color) {
|
function parseRGB(color) {
|
||||||
const [r, g, b, a = 1] = color.match(/[.\d]+/g).map(Number);
|
const [r, g, b, a = 1] = color.match(/[.\d]+/g).map(Number);
|
||||||
return {r, g, b, a};
|
return {r, g, b, a};
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ var usercss = (function () {
|
||||||
}
|
}
|
||||||
color = getComputedStyle(el).color;
|
color = getComputedStyle(el).color;
|
||||||
el.style.color = '';
|
el.style.color = '';
|
||||||
return _parse(color);
|
return parseRGB(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
function format({r, g, b, a = 1}) {
|
function format({r, g, b, a = 1}) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user