Also note that the "richter" program is included in the package.

On Monday, August 28, 2017 at 9:35:25 AM UTC-4, ajstarks wrote:
>
> it would be helpful to better understand what you want to do, but:
>
> https://speakerdeck.com/ajstarks/svgo-code-plus-picture-examples
>
> includes the code below (with many other examples would should be 
> illustrate the capabilities of the package)
>
> package main
>
>
> import (
>
> "math/rand"
>
> "os"
>
> "time"
>
>
> "github.com/ajstarks/svgo"
>
> )
>
>
> var (
>
> canvas = svg.New(os.Stdout)
>
> width  = 500
>
> height = 500
>
> )
>
>
> // inspired by Gerhard Richter's 256 colors, 1974
>
> func main() {
>
> rand.Seed(time.Now().Unix())
>
> canvas.Start(width, height)
>
> canvas.Rect(0, 0, width, height)
>
>
> w, h, gutter := 24, 18, 5
>
> rows, cols := 16, 16
>
> top, left := 20, 20
>
>
> for r, x := 0, left; r < rows; r++ {
>
> for c, y := 0, top; c < cols; c++ {
>
> canvas.Rect(x, y, w, h,
>
> canvas.RGB(rand.Intn(255), rand.Intn(255), rand.Intn(255)))
>
> y += (h + gutter)
>
> }
>
> x += (w + gutter)
>
> }
>
> canvas.End()
>
> }
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to