{"id":37165385,"url":"https://github.com/visualfc/gg","last_synced_at":"2026-01-14T19:37:09.031Z","repository":{"id":57593725,"uuid":"169971417","full_name":"visualfc/gg","owner":"visualfc","description":"Go Graphics - 2D rendering in Go with a simple API.","archived":false,"fork":true,"pushed_at":"2019-02-13T00:52:18.000Z","size":649,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-20T05:24:28.936Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/fogleman/gg","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fogleman/gg","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/visualfc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-10T11:35:32.000Z","updated_at":"2019-06-08T04:37:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/visualfc/gg","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/visualfc/gg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualfc%2Fgg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualfc%2Fgg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualfc%2Fgg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualfc%2Fgg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/visualfc","download_url":"https://codeload.github.com/visualfc/gg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visualfc%2Fgg/sbom","scorecard":{"id":923776,"data":{"date":"2025-08-04","repo":{"name":"github.com/visualfc/gg","commit":"9e732dfecee14fbdac70edac6ae0b06d1338a1fd"},"scorecard":{"version":"v5.2.1-28-gc1d103a9","commit":"c1d103a9bb9f635ec7260bf9aa0699466fa4be0e"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-25T08:33:55.350Z","repository_id":57593725,"created_at":"2025-08-25T08:33:55.350Z","updated_at":"2025-08-25T08:33:55.350Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28432656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T19:37:08.322Z","updated_at":"2026-01-14T19:37:09.016Z","avatar_url":"https://github.com/visualfc.png","language":"Go","readme":"# Go Graphics\n\n`gg` is a library for rendering 2D graphics in pure Go.\n\n![Stars](http://i.imgur.com/CylQIJt.png)\n\n## Installation\n\n    go get -u github.com/fogleman/gg\n\nAlternatively, you may use gopkg.in to grab a specific major-version:\n\n    go get -u gopkg.in/fogleman/gg.v1\n\n## Documentation\n\nhttps://godoc.org/github.com/fogleman/gg\n\n## Hello, Circle!\n\nLook how easy!\n\n```go\npackage main\n\nimport \"github.com/fogleman/gg\"\n\nfunc main() {\n    dc := gg.NewContext(1000, 1000)\n    dc.DrawCircle(500, 500, 400)\n    dc.SetRGB(0, 0, 0)\n    dc.Fill()\n    dc.SavePNG(\"out.png\")\n}\n```\n\n## Examples\n\nThere are [lots of examples](https://github.com/fogleman/gg/tree/master/examples) included. They're mostly for testing the code, but they're good for learning, too.\n\n![Examples](http://i.imgur.com/tMFoyzu.png)\n\n## Creating Contexts\n\nThere are a few ways of creating a context.\n\n```go\nNewContext(width, height int) *Context\nNewContextForImage(im image.Image) *Context\nNewContextForRGBA(im *image.RGBA) *Context\n```\n\n## Drawing Functions\n\nEver used a graphics library that didn't have functions for drawing rectangles\nor circles? What a pain!\n\n```go\nDrawPoint(x, y, r float64)\nDrawLine(x1, y1, x2, y2 float64)\nDrawRectangle(x, y, w, h float64)\nDrawRoundedRectangle(x, y, w, h, r float64)\nDrawCircle(x, y, r float64)\nDrawArc(x, y, r, angle1, angle2 float64)\nDrawEllipse(x, y, rx, ry float64)\nDrawEllipticalArc(x, y, rx, ry, angle1, angle2 float64)\nDrawRegularPolygon(n int, x, y, r, rotation float64)\nDrawImage(im image.Image, x, y int)\nDrawImageAnchored(im image.Image, x, y int, ax, ay float64)\nSetPixel(x, y int)\n\nMoveTo(x, y float64)\nLineTo(x, y float64)\nQuadraticTo(x1, y1, x2, y2 float64)\nCubicTo(x1, y1, x2, y2, x3, y3 float64)\nClosePath()\nClearPath()\nNewSubPath()\n\nClear()\nStroke()\nFill()\nStrokePreserve()\nFillPreserve()\n```\n\nIt is often desired to center an image at a point. Use `DrawImageAnchored` with `ax` and `ay` set to 0.5 to do this. Use 0 to left or top align. Use 1 to right or bottom align. `DrawStringAnchored` does the same for text, so you don't need to call `MeasureString` yourself.\n\n## Text Functions\n\nIt will even do word wrap for you!\n\n```go\nDrawString(s string, x, y float64)\nDrawStringAnchored(s string, x, y, ax, ay float64)\nDrawStringWrapped(s string, x, y, ax, ay, width, lineSpacing float64, align Align)\nMeasureString(s string) (w, h float64)\nMeasureMultilineString(s string, lineSpacing float64) (w, h float64)\nWordWrap(s string, w float64) []string\nSetFontFace(fontFace font.Face)\nLoadFontFace(path string, points float64) error\n```\n\n## Color Functions\n\nColors can be set in several different ways for your convenience.\n\n```go\nSetRGB(r, g, b float64)\nSetRGBA(r, g, b, a float64)\nSetRGB255(r, g, b int)\nSetRGBA255(r, g, b, a int)\nSetColor(c color.Color)\nSetHexColor(x string)\n```\n\n## Stroke \u0026 Fill Options\n\n```go\nSetLineWidth(lineWidth float64)\nSetLineCap(lineCap LineCap)\nSetLineJoin(lineJoin LineJoin)\nSetDash(dashes ...float64)\nSetFillRule(fillRule FillRule)\n```\n\n## Gradients \u0026 Patterns\n\n`gg` supports linear and radial gradients and surface patterns. You can also implement your own patterns.\n\n```go\nSetFillStyle(pattern Pattern)\nSetStrokeStyle(pattern Pattern)\nNewSolidPattern(color color.Color)\nNewLinearGradient(x0, y0, x1, y1 float64)\nNewRadialGradient(x0, y0, r0, x1, y1, r1 float64)\nNewSurfacePattern(im image.Image, op RepeatOp)\n```\n\n## Transformation Functions\n\n```go\nIdentity()\nTranslate(x, y float64)\nScale(x, y float64)\nRotate(angle float64)\nShear(x, y float64)\nScaleAbout(sx, sy, x, y float64)\nRotateAbout(angle, x, y float64)\nShearAbout(sx, sy, x, y float64)\nTransformPoint(x, y float64) (tx, ty float64)\nInvertY()\n```\n\nIt is often desired to rotate or scale about a point that is not the origin. The functions `RotateAbout`, `ScaleAbout`, `ShearAbout` are provided as a convenience.\n\n`InvertY` is provided in case Y should increase from bottom to top vs. the default top to bottom.\n\n## Stack Functions\n\nSave and restore the state of the context. These can be nested.\n\n```go\nPush()\nPop()\n```\n\n## Clipping Functions\n\nUse clipping regions to restrict drawing operations to an area that you\ndefined using paths.\n\n```go\nClip()\nClipPreserve()\nResetClip()\nAsMask() *image.Alpha\nSetMask(mask *image.Alpha)\nInvertMask()\n```\n\n## Helper Functions\n\nSometimes you just don't want to write these yourself.\n\n```go\nRadians(degrees float64) float64\nDegrees(radians float64) float64\nLoadImage(path string) (image.Image, error)\nLoadPNG(path string) (image.Image, error)\nSavePNG(path string, im image.Image) error\n```\n\n![Separator](http://i.imgur.com/fsUvnPB.png)\n\n## Another Example\n\nSee the output of this example below.\n\n```go\npackage main\n\nimport \"github.com/fogleman/gg\"\n\nfunc main() {\n\tconst S = 1024\n\tdc := gg.NewContext(S, S)\n\tdc.SetRGBA(0, 0, 0, 0.1)\n\tfor i := 0; i \u003c 360; i += 15 {\n\t\tdc.Push()\n\t\tdc.RotateAbout(gg.Radians(float64(i)), S/2, S/2)\n\t\tdc.DrawEllipse(S/2, S/2, S*7/16, S/8)\n\t\tdc.Fill()\n\t\tdc.Pop()\n\t}\n\tdc.SavePNG(\"out.png\")\n}\n```\n\n![Ellipses](http://i.imgur.com/J9CBZef.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisualfc%2Fgg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisualfc%2Fgg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisualfc%2Fgg/lists"}