MediaWiki:Gadget-dark-vector.js: Difference between revisions
From Inkipedia, the Splatoon wiki
(This should be it) |
(Replaced with new code to dim bright table elements) |
||
Line 1: | Line 1: | ||
mw.loader.using("jquery", function () { | |||
$("[ | $("td[style]").each(function () { | ||
var _c = this.style.backgroundColor.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+)\s*)?\)$/i) | |||
if (_c == null) return | |||
_c = _c.slice(1, 5).map(function (e, i) { return parseInt(i == 3 ? parseInt(e) : (parseInt(e) - 175)) }); | |||
if (isNaN(_c[3])) _c[3] = 1; | |||
this.style.backgroundColor = "rgba(" + _c.join(",") + ")"; | |||
}) | |||
}) | }) |
Revision as of 20:44, 4 August 2021
mw.loader.using("jquery", function () { $("td[style]").each(function () { var _c = this.style.backgroundColor.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+)\s*)?\)$/i) if (_c == null) return _c = _c.slice(1, 5).map(function (e, i) { return parseInt(i == 3 ? parseInt(e) : (parseInt(e) - 175)) }); if (isNaN(_c[3])) _c[3] = 1; this.style.backgroundColor = "rgba(" + _c.join(",") + ")"; }) })