fix: some

This commit is contained in:
2024-06-18 21:19:23 +03:00
parent 34c0ea5fa1
commit dd59a605ad
4 changed files with 10 additions and 16 deletions

View File

@@ -38,18 +38,14 @@
let colorChangeBtnRed = document.getElementById('colorChangeBtnRed');
colorChangeBtnRed.addEventListener('click', function () {
var hexColor = '#FF0000'
.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => '#ff' + r + r + g + g + b + b)
.substring(1);
var hexColor = '#FF0000'.substring(1);
var numColor = parseInt(hexColor, 16);
appState.changeColor(numColor, true);
});
let colorChangeBtnBlue = document.getElementById('colorChangeBtnBlue');
colorChangeBtnBlue.addEventListener('click', function () {
var hexColor = '#0000FF'
.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => '#ff' + r + r + g + g + b + b)
.substring(1);
var hexColor = '#0000FF'.substring(1);
var numColor = parseInt(hexColor, 16);
appState.changeColor(numColor, false);
});
@@ -60,7 +56,7 @@
});
function onError() {
console.error('aboba');
console.error('Error');
}
appState.setOnError(onError);