mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-11 22:23:32 +08:00
sorting themes by lightness
This commit is contained in:
parent
6593de3470
commit
0bf6a7b19c
1 changed files with 6 additions and 0 deletions
|
@ -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:${
|
||||
|
|
Loading…
Reference in a new issue