Skip to content

Commit

Permalink
style: invert colors
Browse files Browse the repository at this point in the history
  • Loading branch information
istudyatuni committed Feb 9, 2022
1 parent 3d2ed2d commit 076f8fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/Canvas.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
function init() {
gl = canvas.getContext('2d')
gl.rect(0, 0, width, height)
gl.fillStyle = 'white'
gl.fillStyle = 'black'
gl.fill()
gl.strokeStyle = 'black'
gl.strokeStyle = 'white'
draw()
}
Expand Down
10 changes: 5 additions & 5 deletions src/utils/canvas/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ export async function drawMandelbrot(image, lx, rx) {

for (let i = 0, j = 0; i < len; i++, j += 4) {
if (result[i]) {
// black
image.data[j] = 0
image.data[j + 1] = 0
image.data[j + 2] = 0
} else {
// white
image.data[j] = 255
image.data[j + 1] = 255
image.data[j + 2] = 255
} else {
// black
image.data[j] = 0
image.data[j + 1] = 0
image.data[j + 2] = 0
}
}

Expand Down

0 comments on commit 076f8fc

Please sign in to comment.