{"id":15038625,"url":"https://github.com/igenius-srl/igcolorpicker","last_synced_at":"2025-04-06T02:09:47.574Z","repository":{"id":49445148,"uuid":"79820706","full_name":"iGenius-Srl/IGColorPicker","owner":"iGenius-Srl","description":"A customizable color picker for iOS in Swift","archived":false,"fork":false,"pushed_at":"2021-06-17T12:29:00.000Z","size":517,"stargazers_count":277,"open_issues_count":19,"forks_count":79,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-06T02:09:43.713Z","etag":null,"topics":["color-picker","colorpickerview","crystal","igenius","ios-color","swift","swiftcolorpicker"],"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/iGenius-Srl.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":"2017-01-23T16:06:22.000Z","updated_at":"2024-06-25T12:26:19.000Z","dependencies_parsed_at":"2022-09-07T01:40:12.831Z","dependency_job_id":null,"html_url":"https://github.com/iGenius-Srl/IGColorPicker","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGenius-Srl%2FIGColorPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGenius-Srl%2FIGColorPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGenius-Srl%2FIGColorPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGenius-Srl%2FIGColorPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iGenius-Srl","download_url":"https://codeload.github.com/iGenius-Srl/IGColorPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"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":["color-picker","colorpickerview","crystal","igenius","ios-color","swift","swiftcolorpicker"],"created_at":"2024-09-24T20:39:18.560Z","updated_at":"2025-04-06T02:09:47.554Z","avatar_url":"https://github.com/iGenius-Srl.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![alt text](https://github.com/iGenius-Srl/IGColorPicker/blob/master/Resources/Logo.png \"IGColorPicker\")\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/language-swift%205-orange.svg\" alt=\"Language: Swift 5\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/license-MIT-000000.svg\" alt=\"License: MIT\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-iOS-blue.svg\" alt=\"Platform: iOS\"\u003e\n\u003c/p\u003e\n\nIGColorPicker is a fantastic color picker 🎨 written in Swift. \n\n![alt text](https://github.com/iGenius-Srl/IGColorPicker/blob/master/Resources/wall-examples.png \"Examples\")\n\n## Table of Contents\n* [**Documentation**](#documentation)\n  * [Colors](#colors)\n  * [Style](#style)\n  * [Other features](#other-features)\n* [**Installation**](#installation)\n  * [Example](#example)\n* [**Getting Started**](#getting-started)\n  * [ColorPickerView](#colorpickerview)\n  * [Delegate](#delegate)\n  * [Layout](#layout)\n* [**Project Details**](#project-details)\n  * [Requirements](#requirements)\n  * [Contributing](#contributing)\n  * [Author](#author)\n  * [License](#license)\n\n## Documentation\n### Colors\nThe color picker comes with our set of colors:\n\n![alt text](https://github.com/iGenius-Srl/IGColorPicker/blob/master/Resources/Palette.png \"Color Palette\")\n\nBut if you don't like them, you are free to use your own colors 🖍:\n```swift\n\ncolorPickerView.colors = [UIColor.red, UIColor.yellow, UIColor.green, UIColor.black]\n\n```\n\n### Style\n* **style** ```enum```: look and feel of color picker cells\n  * **circle**\n\n    ![alt text](https://github.com/iGenius-Srl/IGColorPicker/blob/master/Resources/Circle.png \"Circle style\")\n\n  * **square**\n\n    ![alt text](https://github.com/iGenius-Srl/IGColorPicker/blob/master/Resources/Square.png \"Square style\")\n\n* **selectionStyle** ```enum```: style applied when a color is selected\n  * **check**\n\n    ![alt text](https://github.com/iGenius-Srl/IGColorPicker/blob/master/Resources/Check.png \"Check selection style\")\n\n  * **none**\n\n    ![alt text](https://github.com/iGenius-Srl/IGColorPicker/blob/master/Resources/None.png \"None selection style\")\n\n### Other features\n* **preselectedIndex** ```Int?```: the index of the preselected color in the color picker\n\n* **isSelectedColorTappable** ```Bool```: if true, the selected color can be deselected by a tap\n\n* **scrollToPreselectedIndex** ```Bool```: if true, the preselectedIndex is showed in the center of the color picker\n\n\n## Installation\n\nIGColorPicker is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your `Podfile`:\n\n```ruby\npod 'IGColorPicker'\n```\n### Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Getting Started\n### ColorPickerView\n\n`ColorPickerView` is just a class that inheritance from `UIView`, so you can both use a storyboard or you can create the color picker programmatically:\n\n#### Storyboard\n* Add a `UIView` to the storyboard. Go to the **Identity inspector** and in set its class to `ColorPickerView`.\n* Just drag and drop the view in the correct class  🤙🏻\n\n#### Programmatically\nJust initialize the color picker like one would initialize a `UIView`, and add it as a subview to your view hierarchy.\n\n```swift\nimport IGColorPicker\n\nclass ViewController {\n  var colorPickerView: ColorPickerView!\n\n  override func viewDidLoad() {\n    super.viewDidLoad()\n\n    colorPickerView = ColorPickerView(frame: CGRect(x: 0.0, y: 0.0, width: widthSize, height: heightSize))\n    view.addSubview(colorPickerView)\n  }\n\n}\n\n```\n\n### Delegate\n`ColorPickerViewDelegate` is the delegate protocol that recognizes the tap gesture on a color. This is an option delegate, but if you need to know when the user selects a color you should implement it.\n\n```swift\n\n// Set the delegate 🙋🏻‍♂️\ncolorPickerView.delegate = self\n\n// MARK: - ColorPickerViewDelegate\nextension ViewController: ColorPickerViewDelegate {\n\n  func colorPickerView(_ colorPickerView: ColorPickerView, didSelectItemAt indexPath: IndexPath) {\n    // A color has been selected\n  }\n\n  // This is an optional method\n  func colorPickerView(_ colorPickerView: ColorPickerView, didDeselectItemAt indexPath: IndexPath) {\n    // A color has been deselected\n  }\n\n}\n\n```\n\n### Layout\n\nEvery developer can customize the color picker layout in the way to fit with their design. To do that you have to implement our layout delegate `ColorPickerViewDelegateFlowLayout`\n\n```swift\n// Set the delegate 🙋🏻‍♂️\ncolorPickerView.layoutDelegate = self\n\n// MARK: - ColorPickerViewDelegateFlowLayout\nextension ViewController: ColorPickerViewDelegateFlowLayout {\n\n  // ------------------------------------------------------------------\n  // All these methods are optionals, your are not to implement them 🖖🏻\n  // ------------------------------------------------------------------\n\n  func colorPickerView(_ colorPickerView: ColorPickerView, sizeForItemAt indexPath: IndexPath) -\u003e CGSize {\n    // The size for each cell\n    // 👉🏻 WIDTH AND HEIGHT MUST BE EQUALS!\n  }\n\n  func colorPickerView(_ colorPickerView: ColorPickerView, minimumLineSpacingForSectionAt section: Int) -\u003e CGFloat {\n    // Space between cells\n  }\n\n  func colorPickerView(_ colorPickerView: ColorPickerView, minimumInteritemSpacingForSectionAt section: Int) -\u003e CGFloat {\n    // Space between rows\n  }\n\n  func colorPickerView(_ colorPickerView: ColorPickerView, insetForSectionAt section: Int) -\u003e UIEdgeInsets {\n    // Inset used aroud the view\n  }\n\n}\n\n```\n\n## Project Details\n\n### Requirements\n* Swift 4.1\n* Xcode 9.0+\n* iOS 8.3+\n\n### Contributing\nFeel free to collaborate with ideas 💭 , issues ⁉️ and/or pull requests 🔃.\n\nHere is a list of ToDo about bug fix and new features you can work on:\n* Custom check size\n* Support to custom view in `ColorPickerViewSelectStyle`\n* Support custom style in `ColorPickerViewStyle`\n* Substitute `M13Checkbox` with another framework. Or just create a custom checkbox with animation\n\n**P.S.** If you use IGColorPicker in your app we would love to hear about it! 😉\n\n### License\n\n\u003e Copyright (c) 2018 iGenius Srl\n\n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy\n\u003e of this software and associated documentation files (the \"Software\"), to deal\n\u003e in the Software without restriction, including without limitation the rights\n\u003e to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\u003e copies of the Software, and to permit persons to whom the Software is\n\u003e furnished to do so, subject to the following conditions:\n\n\u003e The above copyright notice and this permission notice shall be included in\n\u003e all copies or substantial portions of the Software.\n\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\u003e IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\u003e FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\u003e AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\u003e LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\u003e OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\u003e THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figenius-srl%2Figcolorpicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figenius-srl%2Figcolorpicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figenius-srl%2Figcolorpicker/lists"}