package gg
This commit is contained in:
parent
99bd03b051
commit
80f52004a0
@ -1,4 +1,4 @@
|
||||
package dd
|
||||
package gg
|
||||
|
||||
import (
|
||||
"image"
|
||||
|
@ -1,9 +1,9 @@
|
||||
package main
|
||||
|
||||
import "github.com/fogleman/dd"
|
||||
import "github.com/fogleman/gg"
|
||||
|
||||
func main() {
|
||||
dc := dd.NewContext(1000, 1000)
|
||||
dc := gg.NewContext(1000, 1000)
|
||||
dc.SetSourceRGB(1, 1, 1)
|
||||
dc.Paint()
|
||||
dc.DrawCircle(500, 500, 400)
|
||||
|
@ -1,9 +1,9 @@
|
||||
package main
|
||||
|
||||
import "github.com/fogleman/dd"
|
||||
import "github.com/fogleman/gg"
|
||||
|
||||
func main() {
|
||||
dc := dd.NewContext(256, 256)
|
||||
dc := gg.NewContext(256, 256)
|
||||
dc.SetSourceRGBA(1, 0, 0, 0.3)
|
||||
dc.Paint()
|
||||
dc.MoveTo(20, 20)
|
||||
|
@ -3,13 +3,13 @@ package main
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"github.com/fogleman/dd"
|
||||
"github.com/fogleman/gg"
|
||||
)
|
||||
|
||||
func main() {
|
||||
const W = 1024
|
||||
const H = 1024
|
||||
dc := dd.NewContext(W, H)
|
||||
dc := gg.NewContext(W, H)
|
||||
dc.SetSourceRGB(0, 0, 0)
|
||||
dc.Paint()
|
||||
for i := 0; i < 1000; i++ {
|
||||
|
@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"math"
|
||||
|
||||
"github.com/fogleman/dd"
|
||||
"github.com/fogleman/gg"
|
||||
)
|
||||
|
||||
type Point struct {
|
||||
@ -22,7 +22,7 @@ func Polygon(n int, x, y, r float64) []Point {
|
||||
func main() {
|
||||
n := 5
|
||||
points := Polygon(n, 512, 512, 400)
|
||||
dc := dd.NewContext(1024, 1024)
|
||||
dc := gg.NewContext(1024, 1024)
|
||||
dc.SetSourceRGB(1, 1, 1)
|
||||
dc.Paint()
|
||||
for i := 0; i < n+1; i++ {
|
||||
@ -31,7 +31,7 @@ func main() {
|
||||
dc.LineTo(p.X, p.Y)
|
||||
}
|
||||
dc.SetSourceRGBA(0, 0.5, 0, 1)
|
||||
dc.SetFillRule(dd.FillRuleEvenOdd)
|
||||
dc.SetFillRule(gg.FillRuleEvenOdd)
|
||||
dc.FillPreserve()
|
||||
dc.SetSourceRGBA(0, 1, 0, 0.5)
|
||||
dc.SetLineWidth(16)
|
||||
|
@ -1,9 +1,9 @@
|
||||
package main
|
||||
|
||||
import "github.com/fogleman/dd"
|
||||
import "github.com/fogleman/gg"
|
||||
|
||||
func main() {
|
||||
dc := dd.NewContext(1000, 1000)
|
||||
dc := gg.NewContext(1000, 1000)
|
||||
dc.SetSourceRGB(1, 1, 1)
|
||||
dc.Paint()
|
||||
dc.SetSourceRGB(0, 0, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user