From 81765e2a169898c4844b64b0469e269e129123ed Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Tue, 31 Jul 2018 15:28:28 -0600 Subject: [PATCH] Experimenting with adding colors --- web/render.go | 11 ++++++----- web/web.go | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/web/render.go b/web/render.go index 54eddba..34761c4 100644 --- a/web/render.go +++ b/web/render.go @@ -19,13 +19,13 @@ const ( Brighten = 1024 ) -func mandelbrot(c complex128) uint16 { +func mandelbrot(c complex128) uint8 { var z complex128 for i := 0; i < Iterations; i++ { z = z*z + c if cmplx.IsNaN(z) { - return uint16(i) + return uint8(i) } } @@ -33,7 +33,7 @@ func mandelbrot(c complex128) uint16 { } type pixel struct { - out *image.Gray16 + out *image.RGBA x, y int tileX, tileY int64 tileZoom uint8 @@ -50,7 +50,8 @@ func computeThread() { (float64(p.y)/Size+float64(p.tileY))/float64(uint(1<