{"id":13694044,"url":"https://github.com/buchanae/ink","last_synced_at":"2025-05-05T20:27:39.815Z","repository":{"id":44402131,"uuid":"227532164","full_name":"buchanae/ink","owner":"buchanae","description":"Creative coding in Go","archived":false,"fork":false,"pushed_at":"2021-11-17T16:54:30.000Z","size":15971,"stargazers_count":156,"open_issues_count":1,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-05T20:27:32.940Z","etag":null,"topics":["2d-graphics","creative-coding","generative-art","golang","opengl"],"latest_commit_sha":null,"homepage":"https://buchanae.github.io/ink/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buchanae.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-12T06:03:05.000Z","updated_at":"2025-03-20T20:57:03.000Z","dependencies_parsed_at":"2022-07-15T05:16:42.392Z","dependency_job_id":null,"html_url":"https://github.com/buchanae/ink","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buchanae%2Fink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buchanae%2Fink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buchanae%2Fink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buchanae%2Fink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buchanae","download_url":"https://codeload.github.com/buchanae/ink/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252570178,"owners_count":21769600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d-graphics","creative-coding","generative-art","golang","opengl"],"created_at":"2024-08-02T17:01:23.115Z","updated_at":"2025-05-05T20:27:39.779Z","avatar_url":"https://github.com/buchanae.png","language":"Go","funding_links":[],"categories":["开源类库","Open source library"],"sub_categories":["图表","Charts"],"readme":"\u003ca href=\"https://godoc.org/github.com/buchanae/ink\"\u003e\u003cimg src=\"https://godoc.org/github.com/buchanae/ink?status.svg\" alt=\"GoDoc\"\u003e\u003c/a\u003e\n\nInk is a framework for creative 2D graphics in [Go](https://golang.org), based on OpenGL. Visit [buchanae.github.io/ink](https://buchanae.github.io/ink/) for more.\n\n### Example: a simple triangle\nInstall:\n```\ngo get github.com/buchanae/ink\n```\n\n(Building Ink is a little tricky, because it depends on GLFW. You might need to install these packages:\n```\nbuild-essential\nxorg-dev \n```\n\nWrite `example.go`:\n```go\npackage main\n\nimport (\n\t. \"github.com/buchanae/ink/color\"\n\t. \"github.com/buchanae/ink/dd\"\n\t\"github.com/buchanae/ink/gfx\"\n)\n\nfunc Ink(doc gfx.Doc) {\n\tt := Triangle{\n\t\tXY{0.2, 0.2},\n\t\tXY{0.8, 0.2},\n\t\tXY{0.5, 0.8},\n\t}\n\ts := gfx.Fill{Shape: t}.Shader()\n\ts.Set(\"a_color\", []RGBA{\n\t\tRed, Green, Blue,\n\t})\n\ts.Draw(doc)\n}\n```\n\nRun:\n```\nink example.go\n```\n\nInk opens a window and renders your triangle:\n\n![Triangle example](https://buchanae.github.io/ink/assets/snapshots/001_triangle.png)\n\nThere are more examples in the [sketches](./sketches) directory.\n\n### Implementation Notes\n\n- Ink is based on OpenGL only, although other backends are desired. There is an experimental WebGL branch.\n- Ink is focused on 2D graphics, although 3D is desired some day.\n- Most numbers are float32, because OpenGL APIs are mostly based on float32s.\n  - This is also why I haven't used the Go stdlib `image/color`. I admit this feels messy.\n- Angles are in radians, unless otherwise noted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuchanae%2Fink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuchanae%2Fink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuchanae%2Fink/lists"}