add color picker

This commit is contained in:
2023-10-23 09:16:46 +02:00
parent 2e5125c298
commit 4a0d03f445
2 changed files with 10 additions and 0 deletions

View File

@ -172,6 +172,9 @@ function oninput() {
this.previousPlaceholder = this.placeholder
refreshBox(this)
}
if (penColor) {
this.style.setProperty("color", penColor)
}
}
function refreshBox(box) {
@ -321,6 +324,12 @@ function insert(radio) {
}
}
let penColor
function changeColor() {
penColor = colorPicker.value
}
function undo() {
if (history.length) {
const previousState = history.pop()