From 7e473fe72c21b1a0d7eb793ee441b1be81033c44 Mon Sep 17 00:00:00 2001 From: chris48s Date: Wed, 23 Jan 2019 21:41:10 +0000 Subject: [PATCH] pre-compute the 3 most common icon styles on server init (#2856) refs #2833 (comment) --- lib/load-simple-icons.js | 12 +++++++++--- lib/logos.js | 22 +++++++++++++--------- lib/logos.spec.js | 6 +++--- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/lib/load-simple-icons.js b/lib/load-simple-icons.js index 6e8a4e8725..47af134356 100644 --- a/lib/load-simple-icons.js +++ b/lib/load-simple-icons.js @@ -10,9 +10,15 @@ function loadSimpleIcons() { simpleIcons[k] = simpleIcons[key] delete simpleIcons[key] } - simpleIcons[k].base64 = svg2base64( - simpleIcons[k].svg.replace('= 0.6) { - return '#333' + return 'dark' } - return hex + return 'default' } function getSimpleIcon({ name, color, style }) { @@ -87,11 +87,15 @@ function getSimpleIcon({ name, color, style }) { return undefined } - const { svg } = simpleIcons[key] - const svgColor = - toSvgColor(color) || - toSvgColor(getSimpleIconColor({ icon: simpleIcons[key], style })) - return svg2base64(svg.replace('