https://github.com/noppefoxwolf/colorpicker
A opensource color picker UI component for iOS
https://github.com/noppefoxwolf/colorpicker
color-picker colorpicker ios ui-components
Last synced: 13 days ago
JSON representation
A opensource color picker UI component for iOS
- Host: GitHub
- URL: https://github.com/noppefoxwolf/colorpicker
- Owner: noppefoxwolf
- Created: 2022-03-13T12:22:57.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-19T18:17:47.000Z (almost 3 years ago)
- Last Synced: 2024-05-02T05:45:52.320Z (12 months ago)
- Topics: color-picker, colorpicker, ios, ui-components
- Language: Swift
- Homepage:
- Size: 3.67 MB
- Stars: 19
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ColorPicker
`ColorPicker` is a UI component for pick a color.

# Requirements
- Swift 6
- iOS 15
# Installation
[Adding Package Dependencies to Your App](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app)
# Getting Started
## Present ColorPicker
```swift
import ColorPicker
...
let vc = ColorPickerViewController()
vc.setDelegate(self)
present(vc, animated: true)
```## Customize swatch colors
```swift
let vc = ColorPickerViewController()
var configuration = ColorPickerConfiguration.default
configuration.initialColor = .red
configuration.initialColorItems = [.init(id: UUID(), color: .red)]
vc.configuration = configuration
vc.setDelegate(self)
present(vc, animated: true)
```## Handle changed color
```swift
extension ContentViewController: ColorPickerViewControllerDelegate {
func colorPickerViewControllerDidFinish(_ viewController: ColorPickerViewController) {
print(#function, viewController.selectedColor)
}
func colorPickerViewController(_ viewController: ColorPickerViewController, didSelect color: UIColor, continuously: Bool) {
print(#function, color, continuously)
}
}
```# Apps using ColorPicker
- [WebSSH - SysAdmin Tools](https://apps.apple.com/us/app/id497714887)
- [Editormode](https://apps.apple.com/jp/app/id1586258429)# Maintainer
[@noppefoxwolf](https://twitter.com/noppefoxwolf)
# License
ColorPicker is available under the MIT license. See the LICENSE file for more info.
# Prohibited matter 🚫
Forking or contributing in order to disguise the activity of spam accounts as legitimate accounts is prohibited.