Creative coding in Go

GoDoc

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

  • Ink is based on OpenGL only, although other backends are desired. There is an experimental WebGL branch.
  • Ink is focused on 2D graphics, although 3D is desired some day.
  • Most numbers are float32, because OpenGL APIs are mostly based on float32s.
    • This is also why I haven't used the Go stdlib image/color. I admit this feels messy.
  • Angles are in radians, unless otherwise noted.
Similar Resources

Coding Challenge for Fullstacklabs Hiring Process

Cuboids Challenge This API manages bags and cuboids. A cuboid is a three-dimensional rectangular box. Each face of a cuboid is a rectangle and adjacen

Mar 31, 2022

Fake server, Consumer Driven Contracts and help with testing performance from one configuration file with zero system dependencies and no coding whatsoever

Fake server, Consumer Driven Contracts and help with testing performance from one configuration file with zero system dependencies and no coding whatsoever

mockingjay server Mockingjay lets you define the contract between a consumer and producer and with just a configuration file you get: A fast to launch

Jan 6, 2023

GFG Coding Challenge With Golang

Software Engineer Coding challenge How to submit your code Init git repository and commit initial code there (it is not needed to push it somewhere);

Dec 7, 2021

Coding challenge - Word Counts

Word Count Challenge Run the program Build the application with go build. The application accepts input from filename parameters, or from STDIN. For e

Dec 14, 2021

Coding challenge for fullstack and backend developer candidates

todotxt Yet another a Go library for Gina Trapani's todo.txt files. ✅ Features Based on go-todotxt from Fabio Berchtold with: Go mod support Segments

Dec 10, 2022

Coding challenge for fullstack and backend developer candidates

Backend/API Developer Code Challenge Overview In this task, you will develop a commandline interface for working with a standard todo.txt file. (todo.

Sep 19, 2022

Veritone coding challenge for golang

Usage Install go get github.com/mvlipka/veritone_coding_challenge Example packag

Dec 16, 2021

An implementation of the MarsRover coding challenge

An implementation of the MarsRover coding challenge

MarsRover An implementation of the MarsRover coding challenge Mars Rovers A squad of robotic rovers are to be landed by NASA on a plateau on Mars. Thi

Jun 7, 2022

An open source, online coding platform that offers code practice and tutoring in 50 different programming languages

An open source, online coding platform that offers code practice and tutoring in 50 different programming languages

Exercism Golang En este repositorio voy a subir los ejercicios de la plataforma

Jan 7, 2022

For productivity addicts who enjoys coding while listening to Spotify

For productivity addicts who enjoys coding while listening to Spotify

🎵 nvim-spotify For productivity addicts who enjoys coding while listening to Sp

Dec 30, 2022

Go-based 2D game to relax after a long coding time

MoreLoves As simple 2D game to play during time when you need to relax after a deep coding time. On your lovely terminal, use your keyboard keys to na

May 21, 2022

Collection of coding examples from "Go In Practice"

Go In Practice Go In Practice 1. Noteworthy aspects of Go 2. A solid foundation 1. Noteworthy aspects of Go Multiple returns Named return values Read

Jan 3, 2022

Configure instead of coding gin server!

tao-gin _______ _____ _ |__ __| / ____(_) | | __ _ ___ | | __ _ _ __ | |/ _` |/ _ \ | | |_ | |

Jan 10, 2022

Cracking the Coding Interview, 6th Ed

Cracking the Coding Interview, 6th Ed. In order to stay sharp, I try to solve a few of these every week. The repository is organized by chapter. Each

Jan 26, 2022

Go Programming specialization coding projects/assignments/scratchpads

Go-Coursework Go Programming specialization coding projects/assignments/scratchpads This repo contains coding assignments from the Coursera - Golang S

Feb 1, 2022

Simple temporary file upload and transfer web application coding with Go language.

Temp File Transfer Web Application Simple temporary file upload and transfer web application coding with Go language. Explore the Golang » Live Demo T

Dec 2, 2022

Marshmallow provides a flexible and performant JSON unmarshalling in Go. It specializes in dealing with unstructured struct - when some fields are known and some aren't, with zero performance overhead nor extra coding needed.

Marshmallow provides a flexible and performant JSON unmarshalling in Go. It specializes in dealing with unstructured struct - when some fields are known and some aren't, with zero performance overhead nor extra coding needed.

Marshmallow Marshmallow package provides a simple API to perform flexible and performant JSON unmarshalling in Go. Marshmallow specializes in dealing

Dec 26, 2022
Comments
  • No License?

    No License?

    Howdy, new Gopher here, excited to play around with Ink! But wondering what the license for it was & if we could get a formal license file in the repo?

    Thanks and sorry if I missed something obvious!

Go programming language secure coding practices guide

You can download this book in the following formats: PDF, Mobi and ePub. Introduction Go Language - Web Application Secure Coding Practices is a guide

Jan 9, 2023
101+ coding interview problems in Go

116+ Coding Interview Problems with Detailed Solutions The Ultimate Go Study Guide eBook version → Join my mailing list to get the latest updates here

Dec 31, 2022
💯 Materials to help you rock your next coding interview

Tech Interview Handbook Credits: Illustration by @leftaligned Read on the website Black Lives Matter. Support the Equal Justice Initiative What is thi

Jan 4, 2023
Reed-Solomon Erasure Coding in Go

Reed-Solomon Reed-Solomon Erasure Coding in Go, with speeds exceeding 1GB/s/cpu core implemented in pure Go. This is a Go port of the JavaReedSolomon

Jan 7, 2023
high performance coding with golang(Go 语言高性能编程,Go 语言陷阱,Gotchas,Traps)
high performance coding with golang(Go 语言高性能编程,Go 语言陷阱,Gotchas,Traps)

Go 语言高性能编程 订阅 最新动态可以关注:知乎 Go语言 或微博 极客兔兔 订阅方式:watch geektutu/blog ,每篇文章都能收到邮件通知,或通过 RSS 订阅。

Dec 28, 2022
A repository for the X-Team community to collaborate and learn solutions to most coding challenges to help prepare for their interviews.
A repository for the X-Team community to collaborate and learn solutions to most coding challenges to help prepare for their interviews.

Community Coding Challenge Handbook This repository focuses on helping X-Teamers and community members to thrive through coding challenges offering so

Sep 6, 2022
Coding assessment to create Todo app given by Percipia

Coding assessment to create Todo app given by Percipia

Oct 20, 2021
Coding along the book
Coding along the book

Learn Go with Tests Art by Denise Formats Gitbook EPUB or PDF Translations 中文 Português 日本語 한국어 Türkçe Support me I am proud to offer this resource fo

Oct 30, 2021