Created
August 27, 2017 01:14
-
-
Save tariq1890/baf0f0a754ad7de611d91b937ae6d28a to your computer and use it in GitHub Desktop.
Revisions
-
tariq1890 created this gist
Aug 27, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ package main import ( "bufio" "github.com/ajstarks/svgo" "os" ) func main() { width := 1920 height := 1080 lg := []svg.Offcolor{ {0, "rgb(0,0,0)", 200}, {1, "rgb(0,0,0)", 128}, } _ = []svg.Offcolor{ {10, "#00cc00", 1}, {30, "#006600", 1}, {70, "#cc0000", 1}, {90, "#000099", 1}} f, _ := os.Create("lgrad.svg") w := bufio.NewWriter(f) g := svg.New(w) g.Start(width, height) g.Rect(0, 0, width, height, "fill:white") g.Title("Gradients") g.Def() g.LinearGradient("h", 0, 100, 0, 0, lg) g.DefEnd() g.End() }