~juju-qa/ubuntu/yakkety/juju/juju-1.25.8

« back to all changes in this revision

Viewing changes to src/github.com/ajstarks/svgo/newsvg

  • Committer: Nicholas Skaggs
  • Date: 2016-12-02 17:28:37 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161202172837-jkrbdlyjcxtrii2n
Initial commit of 1.25.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
if test $# -lt 1
 
4
then
 
5
    echo "specify a file"
 
6
    exit 2
 
7
fi
 
8
 
 
9
if test ! -f $1 
 
10
then
 
11
cat <<!  > $1
 
12
package main
 
13
 
 
14
import (
 
15
  "github.com/ajstarks/svgo"
 
16
  "os"
 
17
)
 
18
 
 
19
var (
 
20
  width = 500
 
21
  height = 500
 
22
  canvas = svg.New(os.Stdout)
 
23
)
 
24
 
 
25
func background(v int) { canvas.Rect(0, 0, width, height, canvas.RGB(v, v, v)) }
 
26
 
 
27
 
 
28
func main() {
 
29
  canvas.Start(width, height)
 
30
  background(255)
 
31
  
 
32
  // your code here
 
33
  
 
34
  canvas.Grid(0, 0, width, height, 10, "stroke:black;opacity:0.1")
 
35
  canvas.End()
 
36
}
 
37
!
 
38
fi
 
39
$EDITOR $1