sorting themes by lightness

This commit is contained in:
Jack 2020-08-05 18:52:52 +01:00
parent 6593de3470
commit 0bf6a7b19c

View file

@ -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(
`<div class="theme button" theme='${theme.name}' style="color:${