Set color picker default value to black
I noticed that color picker HTML element retains the last picked value from user even after the page is reloaded. This will cause inconsistency between `color` value and the actual `colorEl.value`. This commit will always initialize color picker default value to black, the same way that `color` variable was set originally.
This commit is contained in:
parent
2c455d26f3
commit
90d76fb5be
@ -9,7 +9,8 @@ const ctx = canvas.getContext('2d');
|
||||
|
||||
let size = 10
|
||||
let isPressed = false
|
||||
let color = 'black'
|
||||
colorEl.value = 'black'
|
||||
let color = colorEl.value
|
||||
let x
|
||||
let y
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user