Fix color scaling with high iteration count
Some checks are pending
continuous-integration/drone/push Build is passing

This commit is contained in:
Steven Polley 2019-01-06 17:22:25 -07:00
parent ff0ca4030c
commit 63e25ba2d5

View File

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