{"id":18249019,"url":"https://github.com/maxkonovalov/mkgradientview","last_synced_at":"2025-08-03T16:34:19.668Z","repository":{"id":52523058,"uuid":"44624131","full_name":"maxkonovalov/MKGradientView","owner":"maxkonovalov","description":"🌈 Highly customizable Core Graphics based gradient view for iOS","archived":false,"fork":false,"pushed_at":"2021-02-15T08:40:56.000Z","size":768,"stargazers_count":175,"open_issues_count":1,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-05T01:53:21.731Z","etag":null,"topics":["axial-gradient","bilinear-gradient","circular-gradient","conical-gradient","four-point-gradient","gradient","gradient-view","ios","linear-gradient","swift"],"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/maxkonovalov.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-10-20T17:44:53.000Z","updated_at":"2024-12-12T03:13:45.000Z","dependencies_parsed_at":"2022-09-22T14:25:35.445Z","dependency_job_id":null,"html_url":"https://github.com/maxkonovalov/MKGradientView","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/maxkonovalov/MKGradientView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxkonovalov%2FMKGradientView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxkonovalov%2FMKGradientView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxkonovalov%2FMKGradientView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxkonovalov%2FMKGradientView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxkonovalov","download_url":"https://codeload.github.com/maxkonovalov/MKGradientView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxkonovalov%2FMKGradientView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263069635,"owners_count":23408990,"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":["axial-gradient","bilinear-gradient","circular-gradient","conical-gradient","four-point-gradient","gradient","gradient-view","ios","linear-gradient","swift"],"created_at":"2024-11-05T09:38:57.082Z","updated_at":"2025-07-02T03:32:47.235Z","avatar_url":"https://github.com/maxkonovalov.png","language":"Swift","readme":"# MKGradientView\n\n[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat)](https://developer.apple.com/swift)\n[![Platform](https://img.shields.io/cocoapods/p/MKGradientView.svg?style=flat)](http://cocoapods.org/pods/MKGradientView)\n[![License](https://img.shields.io/cocoapods/l/MKGradientView.svg?style=flat)](http://cocoapods.org/pods/MKGradientView)\n[![Version](https://img.shields.io/cocoapods/v/MKGradientView.svg?style=flat)](http://cocoapods.org/pods/MKGradientView)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nHighly customizable Core Graphics based gradient view\n\n\u003cimg src=\"MKGradientView.png?raw=true\" alt=\"MKGradientView\" width=320\u003e\n\n\n## Features\n#### Available gradient types:\n- Linear (Axial)\n- Radial (Circular)\n- Conical (Angular)\n- Bilinear (Four Point)\n\n## Installation\n### CocoaPods\n\nTo install `MKGradientView` via [CocoaPods](http://cocoapods.org), add the following line to your Podfile:\n\n```\npod 'MKGradientView'\n```\n\n### Carthage\n\nTo install `MKGradientView` via [Carthage](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos), add the following line to your Cartfile:\n\n```\ngithub \"maxkonovalov/MKGradientView\"\n```\n\n## Usage\nSee example Xcode project\n\n### Interface Builder\nSimple 2-color gradients can be set up in Interface Builder. Set your view's custom class to `MKGradientView`.\n\nYou can specify the following custom inspectable properties: \n- `Gradient Type`\n- `Start Color`\n- `End Color`\n- `Start Point`\n- `End Point`\n\n### Code\n```swift\nlet gradientView = GradientView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))\ngradientView.type = .linear\ngradientView.colors = [.red, .green]\ngradientView.locations = [0, 1]\ngradientView.startPoint = CGPoint(x: 0, y: 0)\ngradientView.endPoint = CGPoint(x: 1, y: 1)\nview.addSubview(gradientView)\n```\nTo set up a `Bilinear` gradient, you need to specify `colors2` array:\n\n```swift\nlet gradientView = GradientView(frame: CGRect(x: 100, y: 0, width: 100, height: 100))\ngradientView.type = .bilinear\ngradientView.colors = [.red, .yellow]\ngradientView.colors2 = [.blue, .cyan]\nview.addSubview(gradientView)\n```\n\n## Performance\n`GradientLayer` is image-backed, and the algorithm performance behind it highly depends on the size of the generated image. To speed it up, minimum possible layer size should be used. It can be adjusted with `GradientLayer`'s `contentsScale` property, `1.0` being an optimal value for performance/quality balance. Use lower values like `0.5` to speed up rendering time or set it equal to `UIScreen.main.scale` to get precise result.\n\n\n## Requirements\n- iOS 8.0\n- Xcode 10, Swift 4+\n\n## License\n`MKGradientView` is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxkonovalov%2Fmkgradientview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxkonovalov%2Fmkgradientview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxkonovalov%2Fmkgradientview/lists"}