aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Byron <=>2015-07-20 23:50:15 +1000
committerDaniel Byron <=>2015-07-20 23:50:57 +1000
commitb8f972a40f822f439f421d568f8bd1f77768f948 (patch)
tree9056b2ad7584be791813da6f61ea90d0997d7c26
parentMinor readme change (diff)
downloadschemer2-b8f972a40f822f439f421d568f8bd1f77768f948.tar.xz
schemer2-b8f972a40f822f439f421d568f8bd1f77768f948.zip
Tweaked values for random image generation to avoid zero sized elements
-rw-r--r--image.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/image.go b/image.go
index 35101e0..a461213 100644
--- a/image.go
+++ b/image.go
@@ -314,11 +314,11 @@ func Lines(colors []color.Color, w int, h int, size int, sizevar int, horizontal
func randomImage(colors []color.Color, w int, h int) image.Image {
switch rand.Intn(3) {
case 0:
- return Circles(colors, w, h, rand.Intn(w/2), rand.Intn(w/2), randBool(), randBool(), randBool(), rand.Intn(w/16))
+ return Circles(colors, w, h, rand.Intn(w/2), rand.Intn(w/2), randBool(), randBool(), randBool(), rand.Intn(20))
case 1:
- return Rays(colors, w, h, rand.Intn(h/32), rand.Intn(h/32), randBool(), true, randBool())
+ return Rays(colors, w, h, rand.Intn(h/32)+1, rand.Intn(h/32), randBool(), true, randBool())
case 2:
- return Lines(colors, w, h, rand.Intn(h/32), rand.Intn(h/32), randBool(), randBool(), rand.Intn(h/32), rand.Intn(h/2))
+ return Lines(colors, w, h, rand.Intn(h/32), rand.Intn(h/32), randBool(), randBool(), rand.Intn(h/32), rand.Intn(h/2)+1)
}
return nil
}