Fix active color sticking to color picker when inactive
This commit is contained in:
parent
b42839a202
commit
c6fa64c980
1 changed files with 4 additions and 0 deletions
|
|
@ -180,6 +180,7 @@ function pickBackground() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function convertHexToRGB(val) {
|
function convertHexToRGB(val) {
|
||||||
hex = val.replace(/^#/, '');
|
hex = val.replace(/^#/, '');
|
||||||
|
|
||||||
|
|
@ -214,6 +215,7 @@ function adjustTransparency() {
|
||||||
rangeSlider.style.setProperty('--canvas-color', `rgba(${r},${g},${b},${a})`);
|
rangeSlider.style.setProperty('--canvas-color', `rgba(${r},${g},${b},${a})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function colorGrid() {
|
function colorGrid() {
|
||||||
if (isRgb) {
|
if (isRgb) {
|
||||||
this.style.backgroundColor = randomizeColor();
|
this.style.backgroundColor = randomizeColor();
|
||||||
|
|
@ -239,6 +241,8 @@ function colorGrid() {
|
||||||
|
|
||||||
function changeColor() {
|
function changeColor() {
|
||||||
const buttonID = this.id;
|
const buttonID = this.id;
|
||||||
|
|
||||||
|
colorPicker.classList.remove ("is-active");
|
||||||
|
|
||||||
buttons.forEach(btn => btn.classList.remove("is-active"));
|
buttons.forEach(btn => btn.classList.remove("is-active"));
|
||||||
this.classList.add("is-active");
|
this.classList.add("is-active");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue