From 0bf6a7b19cc8cf27b6849b5bd5dc74691393c8fa Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 5 Aug 2020 18:52:52 +0100 Subject: [PATCH] sorting themes by lightness --- public/js/settings.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/js/settings.js b/public/js/settings.js index c04e222f6..cbfa71b1b 100644 --- a/public/js/settings.js +++ b/public/js/settings.js @@ -169,7 +169,13 @@ fillSettingsPage(); async function fillSettingsPage() { let themesEl = $(".pageSettings .section.themes .buttons").empty(); + getThemesList().then((themes) => { + themes = themes.sort((a, b) => { + let b1 = hexToHSL(a.bgColor); + let b2 = hexToHSL(b.bgColor); + return b2.lgt - b1.lgt; + }); themes.forEach((theme) => { themesEl.append( `