From e901efcb97187a228d30dac249c659b4b7ed3359 Mon Sep 17 00:00:00 2001 From: mmktomato Date: Mon, 17 Dec 2018 07:36:23 +0900 Subject: [PATCH] Invert dark favicons (#114) --- data/theme/base.css | 4 ++++ lib/fast-average-color-4.2.0.min.js | 2 ++ sidebar.js | 16 +++++++++++++++- vtr.html | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 lib/fast-average-color-4.2.0.min.js diff --git a/data/theme/base.css b/data/theme/base.css index 801f35b..3874932 100644 --- a/data/theme/base.css +++ b/data/theme/base.css @@ -145,3 +145,7 @@ body[data-tab-buttons-position="right"] .tabbrowser-tab .tab-buttons .tab-close- image-rendering: -moz-crisp-edges; } } + +.invert { + filter: invert(1); +} diff --git a/lib/fast-average-color-4.2.0.min.js b/lib/fast-average-color-4.2.0.min.js new file mode 100644 index 0000000..fe81962 --- /dev/null +++ b/lib/fast-average-color-4.2.0.min.js @@ -0,0 +1,2 @@ +/*! Fast Average Color | © 2018 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.FastAverageColor=e()}(this,function(){"use strict";var _=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},e=function(){function n(t,e){for(var r=0;r { + if(color.isDark) + { + imgEl.classList.add("invert"); + } + fac.destroy(); + }); + } } log.debug("status: " + tabElement.getAttribute("status")); diff --git a/vtr.html b/vtr.html index cb369f1..bb5b2a0 100644 --- a/vtr.html +++ b/vtr.html @@ -45,6 +45,7 @@ +