{"id":13343925,"url":"https://github.com/artemnovichkov/zepcode","last_synced_at":"2025-10-28T08:44:53.267Z","repository":{"id":37677943,"uuid":"122512003","full_name":"artemnovichkov/zepcode","owner":"artemnovichkov","description":"⚗️ Zeplin extension that generates Swift snippets from colors, fonts, and layers","archived":false,"fork":false,"pushed_at":"2023-01-03T23:34:08.000Z","size":1923,"stargazers_count":80,"open_issues_count":20,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-05T21:43:35.201Z","etag":null,"topics":["extension","swift","zeplin","zeplin-extension"],"latest_commit_sha":null,"homepage":"https://extensions.zeplin.io/artem_novichkov/zepcode","language":"JavaScript","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/artemnovichkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-22T17:33:11.000Z","updated_at":"2024-02-27T17:14:21.000Z","dependencies_parsed_at":"2023-02-01T13:47:10.276Z","dependency_job_id":null,"html_url":"https://github.com/artemnovichkov/zepcode","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemnovichkov%2Fzepcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemnovichkov%2Fzepcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemnovichkov%2Fzepcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemnovichkov%2Fzepcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artemnovichkov","download_url":"https://codeload.github.com/artemnovichkov/zepcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650750,"owners_count":21139681,"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":["extension","swift","zeplin","zeplin-extension"],"created_at":"2024-07-29T19:32:05.441Z","updated_at":"2025-10-28T08:44:48.237Z","avatar_url":"https://github.com/artemnovichkov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\".github/zepcode-logo.png\" width=\"400\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://extensions.zeplin.io\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/zeplin-extension-ffbe12.svg\" alt=\"Zeplin Extension\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/artemnovichkov/zepcode\"\u003e\n    \u003cimg src=\"https://travis-ci.org/artemnovichkov/zepcode.svg?branch=master\" alt=\"Build Status\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[Zeplin extension](https://extensions.zeplin.io/) that generates Swift snippets from colors, fonts and layers.\n\n## Features\n\n- 🖍 Color pallette for iOS\n\n  \u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\n  ```swift\n  import UIKit\n\n  extension UIColor {\n\n      static let electricBlue = UIColor(red: 0/255, green: 86/255, blue: 255/255, alpha: 1)\n  }\n  ```\n  \u003c/details\u003e\n  \u003cdetails\u003e\u003csummary\u003eExample with custom initializer\u003c/summary\u003e\n\n  ```swift\n  import UIKit\n\n  extension UIColor {\n\n      convenience init(r red: Int, g green: Int, b blue: Int, a: CGFloat = 1) { // swiftlint:disable:this identifier_name\n          self.init(red: CGFloat(red) / 255, \n                    green: CGFloat(green) / 255, \n                    blue: CGFloat(blue) / 255, \n                    alpha: a)\n      }\n\n      static let electricBlue = UIColor(r: 0, g: 86, b: 255)\n  }\n  ```\n  \u003c/details\u003e\n  \u003cdetails\u003e\u003csummary\u003eExample with color literals\u003c/summary\u003e\n\n  ```swift\n  import UIKit\n\n  extension UIColor {\n\n      static let electricBlue = #colorLiteral(red: 0, green: 0.337254902, blue: 1, alpha: 1)\n  }\n  ```\n  \u003c/details\u003e\n\n- ✏️ Fonts for iOS\n\n  \u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\n  ```swift\n  import UIKit\n\n  extension UIFont {\n\n      static func BloggerSansBold(ofSize: CGFloat) -\u003e UIFont {\n          return UIFont(name: \"BloggerSans-Bold\", size: size)!\n      }\n  }\n  ```\n\n  \u003c/details\u003e\n\n- 🚧 Snippets for borders and corner radius\n\n  \u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\n  ```swift\n  view.layer.borderWidth = 4\n  view.layer.borderColor = UIColor.white.cgColor\n  view.layer.cornerRadius = 40\n  ```\n\n  \u003c/details\u003e\n\n- 🌚 Snippets for shadows\n\n  \u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\n  ```swift\n  view.layer.shadowColor = UIColor(r: 0, g: 0, b: 0, a: 0.5).cgColor\n  view.layer.shadowOpacity = 1\n  view.layer.shadowOffset = CGSize(width: 0, height: 2)\n  view.layer.shadowRadius = 4 / 2\n  let rect = view.bounds.insetBy(dx: -2, dy: -2)\n  view.layer.shadowPath = UIBezierPath(rect: rect).cgPath\n  ```\n\n  \u003c/details\u003e\n\n- 🎨 Gradients (Work in progress)\n\n  \u003cdetails\u003e\u003csummary\u003eLinear gradient example\u003c/summary\u003e\n\n   Check out [LinearGradientPlayground](.github/LinearGradientPlayground.playground) and read explanation of the implementation [here](https://github.com/artemnovichkov/zepcode/issues/1#issuecomment-370118449).\n\n  \u003c/details\u003e\n   \u003cdetails\u003e\u003csummary\u003eRadial gradient example\u003c/summary\u003e\n\n  ```swift\n  final class RadialGradientView: UIView {\n\n      private var radius: CGFloat {\n          return min(bounds.width / 2, bounds.height / 2)\n      }\n\n      private let colors = [UIColor.red.cgColor, UIColor.neonGreen.cgColor]\n\n      var options: CGGradientDrawingOptions = CGGradientDrawingOptions(rawValue: 0)\n\n      // MARK: - Lifecycle\n\n      override init(frame: CGRect) {\n          super.init(frame: frame)\n          clipsToBounds = true\n      }\n\n      required init?(coder aDecoder: NSCoder) {\n          fatalError(\"init(coder:) has not been implemented\")\n      }\n\n      override func layoutSubviews() {\n          super.layoutSubviews()\n          layer.cornerRadius = radius\n      }\n\n      override func draw(_ rect: CGRect) {\n          let context = UIGraphicsGetCurrentContext()\n\n          let colorSpace = CGColorSpaceCreateDeviceRGB()\n          let colorsCount = colors.count\n          var locations = (0..\u003ccolorsCount).map { i in\n              return CGFloat(i) / CGFloat(colorsCount)\n          }\n\n          guard let gradient = CGGradient(colorsSpace: colorSpace, colors: colors as CFArray, locations: locations) else {\n              return\n          }\n\n          context?.drawRadialGradient(gradient,\n                                     startCenter: center,\n                                     startRadius: 0,\n                                     endCenter: center,\n                                     endRadius: radius,\n                                     options: options)\n          }\n  }\n  ```\n\n  \u003c/details\u003e\n\n## Options\n\n#### Use color names\nUse color names from Color Palette or default `UIColor(red:green:blue:alpha:)` initializers.\n\n#### Initializer style\n\n* **Default** — Use the default `UIColor(red:green:blue:alpha:)` initializer.\n* **Custom** — Use `UIColor(r:g:b:a:)` initializer.\n* **Literal** — Use color literals `#colorLiteral(red:green:blue:alpha:)` that will appear in Xcode as a colored rect that presents a color picker.\n\n#### Use layer extension for shadows\nUse a function below for shadow parameters. Don't forget to add [this extension](.github/CALayer+Shadow.swift) to your project.\n\n```swift\nimport UIKit\n\nextension CALayer {\n\n    func makeShadow(color: UIColor,\n                    x: CGFloat = 0,\n                    y: CGFloat = 0,\n                    blur: CGFloat = 0,\n                    spread: CGFloat = 0) {\n        shadowColor = color.cgColor\n        shadowOpacity = 1\n        shadowOffset = CGSize(width: x, height: y)\n        shadowRadius = blur / 2\n        if spread == 0 {\n            shadowPath = nil\n        }\n        else {\n            let rect = bounds.insetBy(dx: -spread, dy: -spread)\n            shadowPath = UIBezierPath(rect: rect).cgPath\n        }\n    }\n}\n```\n\n## How to Install\n\nZepcode is available on [Zeplin Extensions](https://extensions.zeplin.io).\n\n## How to make a changes\n\nFirst, you need last stable Node.js `^8.9.4`. Follow this [guide](https://github.com/creationix/nvm/blob/master/README.md#installation) if you don't have any.\n\nNext, install project dependencies:\n\n```bash\nnpm i\n```\n\nTo start developing, to make a build or to execute some functions from extension follow this [guide](https://github.com/zeplin/zem#scripts).\n\nTo learn more about zem, [see documentation](https://github.com/zeplin/zem).\n\nIf you like to take full control of your build process you can try [zero](https://github.com/baybara-pavel/zero) boilerplate.\n\n## Authors\n\nArtem Novichkov, novichkoff93@gmail.com [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/artemnovichkov?utm_source=github\u0026utm_medium=button\u0026utm_term=artemnovichkov\u0026utm_campaign=github)\n\nBaybara Pavel, baybara.pavel@gmail.com\n\n## License\n\nZepcode 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%2Fartemnovichkov%2Fzepcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartemnovichkov%2Fzepcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemnovichkov%2Fzepcode/lists"}