{"id":1184,"url":"https://github.com/bakhtiyork/Rough","last_synced_at":"2025-08-06T13:32:45.411Z","repository":{"id":62452995,"uuid":"128899253","full_name":"bakhtiyork/Rough","owner":"bakhtiyork","description":"Rough lets you draw in a sketchy, hand-drawn-like, style.","archived":false,"fork":false,"pushed_at":"2018-04-16T11:42:13.000Z","size":1480,"stargazers_count":99,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-18T05:12:00.781Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bakhtiyork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-10T08:24:20.000Z","updated_at":"2024-07-22T14:25:15.000Z","dependencies_parsed_at":"2022-11-01T23:45:54.776Z","dependency_job_id":null,"html_url":"https://github.com/bakhtiyork/Rough","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakhtiyork%2FRough","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakhtiyork%2FRough/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakhtiyork%2FRough/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakhtiyork%2FRough/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bakhtiyork","download_url":"https://codeload.github.com/bakhtiyork/Rough/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228905501,"owners_count":17989778,"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":[],"created_at":"2024-01-05T20:15:40.760Z","updated_at":"2024-12-09T14:31:00.078Z","avatar_url":"https://github.com/bakhtiyork.png","language":"Swift","funding_links":[],"categories":["Graphics","Libs","Images [🔝](#readme)"],"sub_categories":["Getting Started","Images","Other free courses","Linter"],"readme":"# Rough (Swift)\n\n[![Version](https://img.shields.io/cocoapods/v/Rough.svg?style=flat)](http://cocoapods.org/pods/Rough)\n[![License](https://img.shields.io/cocoapods/l/Rough.svg?style=flat)](http://cocoapods.org/pods/Rough)\n[![Platform](https://img.shields.io/cocoapods/p/Rough.svg?style=flat)](http://cocoapods.org/pods/Rough)\n\nRough lets you draw in a sketchy, hand-drawn-like, style. It is Swift clone of [Rough.js](http://roughjs.com/). The library defines primitives to draw lines, curves, arcs, polygons, circles, and ellipses.\n\n\n## Requirements\nXcode 9, iOS 10\n\n## Installation\n\nRough is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'Rough'\n```\n\n## Usage\n![Rectangle](https://raw.githubusercontent.com/bakhtiyork/Rough/master/docs/img/ex1.png)\n```swift\nlet canvas = roughView.canvas\ncanvas.rectangle(origin: CGPoint(x: 10, y: 10), width: 200, height: 100)\nroughView.setNeedsDisplay()\n```\n\n### Lines and Ellipses\n![Lines and Ellipses](https://raw.githubusercontent.com/bakhtiyork/Rough/master/docs/img/ex2.png)\n```swift\ncanvas.circle(center: CGPoint(x: 80, y: 120), radius: 25)\ncanvas.ellipse(center: CGPoint(x: 300, y: 100), width: 150, height: 80)\ncanvas.line(from: CGPoint(x: 80, y: 120), to: CGPoint(x: 300, y: 100))\n```\n\n### Filling\n![Filling](https://raw.githubusercontent.com/bakhtiyork/Rough/master/docs/img/ex3.png)\n```swift\ncanvas.circle(center: CGPoint(x: 50, y: 50), radius: 40) { options in\n    options.fill = UIColor.red\n} // fill with red hachure\n\ncanvas.rectangle(origin: CGPoint(x: 120, y: 15), width: 80, height: 80) { options in\n    options.fill = UIColor.red\n}\n\ncanvas.circle(center: CGPoint(x: 50, y: 150), radius: 40) {\n    options in\n    options.fill = UIColor(red: 10/255.0, green: 150/255.0, blue: 10/255.0, alpha: 1.0)\n    options.fillWeight = 3 // thicker lines for hachure\n}\n\ncanvas.rectangle(origin: CGPoint(x: 220, y: 15), width: 80, height: 80) { options in\n    options.fill = UIColor.red\n    options.hachureAngle = 60 // angle of hachure\n    options.hachureGap = 8\n}\n\ncanvas.rectangle(origin: CGPoint(x: 120, y: 105), width: 80, height: 80) { options in\n    options.fill = UIColor(red: 1.0, green: 0, blue: 200/255.0, alpha: 0.2)\n    options.fillStyle = .solid // solid fill\n}\n```\n\n\n### Sketching style\n![Sketching style](https://raw.githubusercontent.com/bakhtiyork/Rough/master/docs/img/ex4.png)\n```swift\ncanvas.rectangle(origin: CGPoint(x: 15, y: 15), width: 80, height: 80) { options in\n    options.roughness = 0.5\n    options.fill = UIColor.red\n}\n\ncanvas.rectangle(origin: CGPoint(x: 120, y: 15), width: 80, height: 80) { options in\n    options.roughness = 2.8\n    options.fill = UIColor.blue\n}\n\ncanvas.rectangle(origin: CGPoint(x: 220, y: 15), width: 80, height: 80) { options in\n    options.bowing = 6\n    options.stroke = UIColor.green\n    options.strokeWidth = 3\n}\n```\n\n### SVG Path\n*TODO*\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n\u003cimg alt=\"Screenshot1\" src=\"https://raw.githubusercontent.com/bakhtiyork/Rough/master/docs/img/screenshot1.png\" width=\"320\"\u003e \u003cimg alt=\"Screenshot2\" src=\"https://raw.githubusercontent.com/bakhtiyork/Rough/master/docs/img/screenshot2.png\" width=\"320\"\u003e\n\n\n## Credits\n\nCredits to [Rough.js](http://roughjs.com/) by [Preet](https://github.com/pshihn)\n\n\n## License\n\nRough is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakhtiyork%2FRough","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbakhtiyork%2FRough","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakhtiyork%2FRough/lists"}