Skip to content

Commit

Permalink
Improve key colour picker
Browse files Browse the repository at this point in the history
  • Loading branch information
DjCrqss committed Jan 30, 2024
1 parent 12e01f7 commit ce61b0e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/toolbarfunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ accentPicker.addEventListener('input', function () {

keyBgColPicker.value = getComputedStyle(document.body).getPropertyValue('--key-color').substring(0, 7);
keyBgColPicker.addEventListener('input', function () {
colours[3] = keyBgColPicker.value;
document.documentElement.style.setProperty('--key-color', keyBgColPicker.value);
var opacity = Math.round(keyBgOpacityPicker.value * 255).toString(16);
if (opacity.length == 1) {
opacity = "0" + opacity;
}
colours[3] = keyBgColPicker.value + opacity;
document.documentElement.style.setProperty('--key-color', keyBgColPicker.value + opacity);
saveColours();
});

Expand Down

0 comments on commit ce61b0e

Please sign in to comment.