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:
imsyf 2021-02-22 10:05:02 +07:00
parent 2c455d26f3
commit 90d76fb5be
No known key found for this signature in database
GPG Key ID: 1C6DB773CB7E0EC4

View File

@ -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