From 63e25ba2d50cc92503a42c456d8c8fd019a170c5 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Sun, 6 Jan 2019 17:22:25 -0700 Subject: [PATCH] Fix color scaling with high iteration count --- render.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/render.go b/render.go index 758a56d..334d525 100644 --- a/render.go +++ b/render.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "image" "image/color" "image/png" @@ -47,7 +48,7 @@ func main() { } colorStep := float64(Iterations) - colors = interpolateColors("Hippi", colorStep) + colors = interpolateColors("Plan9", colorStep) log.Fatal(http.ListenAndServe(":6161", nil)) } @@ -60,6 +61,7 @@ func computeThread() { (float64(p.y)/Size+float64(p.tileY))/float64(uint(1<<(p.tileZoom-1))), ), ) + fmt.Println(val) p.out.SetRGBA(p.x, p.y, colors[val]) p.wg.Done() } @@ -176,7 +178,7 @@ func mandelbrot(c complex128) uint16 { for i := 0; i < Iterations; i++ { z = z*z + c if cmplx.IsNaN(z) { - return uint16(i) + return uint16(i * 1024) } } return Iterations