Home

Awesome

<a href="https://godoc.org/github.com/buchanae/ink"><img src="https://godoc.org/github.com/buchanae/ink?status.svg" alt="GoDoc"></a>

Ink is a framework for creative 2D graphics in Go, based on OpenGL. Visit buchanae.github.io/ink for more.

Example: a simple triangle

Install:

go get github.com/buchanae/ink

(Building Ink is a little tricky, because it depends on GLFW. You might need to install these packages:

build-essential
xorg-dev 

Write example.go:

package main

import (
	. "github.com/buchanae/ink/color"
	. "github.com/buchanae/ink/dd"
	"github.com/buchanae/ink/gfx"
)

func Ink(doc gfx.Doc) {
	t := Triangle{
		XY{0.2, 0.2},
		XY{0.8, 0.2},
		XY{0.5, 0.8},
	}
	s := gfx.Fill{Shape: t}.Shader()
	s.Set("a_color", []RGBA{
		Red, Green, Blue,
	})
	s.Draw(doc)
}

Run:

ink example.go

Ink opens a window and renders your triangle:

Triangle example

There are more examples in the sketches directory.

Implementation Notes