diff options
| author | Daniel Byron <=> | 2015-07-20 23:50:15 +1000 |
|---|---|---|
| committer | Daniel Byron <=> | 2015-07-20 23:50:57 +1000 |
| commit | b8f972a40f822f439f421d568f8bd1f77768f948 (patch) | |
| tree | 9056b2ad7584be791813da6f61ea90d0997d7c26 | |
| parent | Minor readme change (diff) | |
| download | schemer2-b8f972a40f822f439f421d568f8bd1f77768f948.tar.xz schemer2-b8f972a40f822f439f421d568f8bd1f77768f948.zip | |
Tweaked values for random image generation to avoid zero sized elements
| -rw-r--r-- | image.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 } |