All Projects → EFPrefix → Efcolorpicker

EFPrefix / Efcolorpicker

Licence: mit
A lightweight color picker in Swift.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Efcolorpicker

Colorpicker
A mininal but complete colorpicker desktop app
Stars: ✭ 766 (+273.66%)
Mutual labels:  color, picker, colorpicker
Pickr
🎨 Flat, simple, multi-themed, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!
Stars: ✭ 3,759 (+1733.66%)
Mutual labels:  color, picker, colorpicker
Colorpicker
jQuery UI widget for color picking (similar to the one in Microsoft Office 2010).
Stars: ✭ 271 (+32.2%)
Mutual labels:  color, picker, colorpicker
Django Colorfield
color field for django models with a nice color-picker in the admin. 🎨
Stars: ✭ 238 (+16.1%)
Mutual labels:  color, picker, colorpicker
Farge
Click on a pixel on your screen and show its color value
Stars: ✭ 307 (+49.76%)
Mutual labels:  color, colorpicker
UnityColorPicker
A standalone color picker asset for Unity
Stars: ✭ 70 (-65.85%)
Mutual labels:  color, colorpicker
Pixel Picker
A tiny menu bar application that helps you pick colours from your screen! 🔍✨
Stars: ✭ 318 (+55.12%)
Mutual labels:  color, picker
Androidpicker
安卓选择器类库,包括日期及时间选择器(可用于出生日期、营业时间等)、单项选择器(可用于性别、民族、职业、学历、星座等)、二三级联动选择器(可用于车牌号、基金定投日期等)、城市地址选择器(分省级、地市级及区县级)、数字选择器(可用于年龄、身高、体重、温度等)、日历选日期择器(可用于酒店及机票预定日期)、颜色选择器、文件及目录选择器、图片选择器等……WheelPicker/DatePicker/TimePicker/OptionPicker/NumberPicker/LinkagePicker/AddressPicker/CarPlatePicker/CalendarPicker/ColorPicker/FilePicker/ImagePicker etc.
Stars: ✭ 5,320 (+2495.12%)
Mutual labels:  picker, colorpicker
ColorPickView
🐾一个自定义的颜色选择view
Stars: ✭ 19 (-90.73%)
Mutual labels:  color, colorpicker
Vanilla Colorful
A tiny color picker custom element for modern web apps (2.7 KB) 🎨
Stars: ✭ 467 (+127.8%)
Mutual labels:  color, colorpicker
Kallewheel
A custom color wheel extension for Adobe Photoshop
Stars: ✭ 16 (-92.2%)
Mutual labels:  color, colorpicker
ColorPick.js
A simple and minimal jQuery color picker plugin for the modern web.
Stars: ✭ 48 (-76.59%)
Mutual labels:  color, picker
Color Picker
A simple color picker application written in pure JavaScript, for modern browsers.
Stars: ✭ 180 (-12.2%)
Mutual labels:  color, picker
a-color-picker
A color picker for web app
Stars: ✭ 97 (-52.68%)
Mutual labels:  color, picker
Swifthuecolorpicker
iOS HUE color picker
Stars: ✭ 44 (-78.54%)
Mutual labels:  color, picker
Colorpickerwpf
Simple color picker control for WPF
Stars: ✭ 71 (-65.37%)
Mutual labels:  color, picker
Bootstrap Colorpicker
Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
Stars: ✭ 1,351 (+559.02%)
Mutual labels:  color, colorpicker
global-color-picker
start the script and click anywhere to get rgb value at the cursor location
Stars: ✭ 31 (-84.88%)
Mutual labels:  color, colorpicker
SheetyColors
An action sheet styled color picker for iOS.
Stars: ✭ 101 (-50.73%)
Mutual labels:  color, picker
React Colorful
🎨 A tiny (2,5 KB) color picker component for React and Preact apps
Stars: ✭ 951 (+363.9%)
Mutual labels:  color, picker

EFColorPicker is a lightweight color picker in Swift, inspired by MSColorPicker.

中文介绍

Overview

Color picker component for iOS. It allows the user to select a color with color components. Key features:

  • iPhone & iPad support
  • Adaptive User Interface
  • Supports RGB and HSB color models
  • Well-documented
  • Compatible with iOS 8.0 (iPhone & iPad) and higher

Preview

iPhone iPad

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Then build and run EFColorPicker.xcworkspace in Xcode, the demo shows how to use and integrate the EFColorPicker into your project.

Requirements

Version Needs
<5.0 Xcode 10.0+
Swift 4.2+
iOS 8.0+
5.x Xcode 10.2+
Swift 5.0+
iOS 8.0+

Installation

EFColorPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'EFColorPicker'

Use

  1. First, include EFColorPicker in your project:
import EFColorPicker
  1. Next, we can call EFColorPicker with pure code:
let colorSelectionController = EFColorSelectionViewController()
let navCtrl = UINavigationController(rootViewController: colorSelectionController)
navCtrl.navigationBar.backgroundColor = UIColor.white
navCtrl.navigationBar.isTranslucent = false
navCtrl.modalPresentationStyle = UIModalPresentationStyle.popover
navCtrl.popoverPresentationController?.delegate = self
navCtrl.popoverPresentationController?.sourceView = sender
navCtrl.popoverPresentationController?.sourceRect = sender.bounds
navCtrl.preferredContentSize = colorSelectionController.view.systemLayoutSizeFitting(
    UILayoutFittingCompressedSize
)

colorSelectionController.delegate = self
colorSelectionController.color = self.view.backgroundColor ?? UIColor.white
colorSelectionController.setMode(mode: EFColorSelectionMode.all)

if UIUserInterfaceSizeClass.compact == self.traitCollection.horizontalSizeClass {
    let doneBtn: UIBarButtonItem = UIBarButtonItem(
        title: NSLocalizedString("Done", comment: ""),
        style: UIBarButtonItemStyle.done,
        target: self,
        action: #selector(ef_dismissViewController(sender:))
    )
    colorSelectionController.navigationItem.rightBarButtonItem = doneBtn
}
self.present(navCtrl, animated: true, completion: nil)

Also we can use EFColorPicker in Storyboard:

if "showPopover" == segue.identifier {
	guard let destNav: UINavigationController = segue.destination as? UINavigationController else {
	    return
	}
	if let size = destNav.visibleViewController?.view.systemLayoutSizeFitting(UILayoutFittingCompressedSize) {
	    destNav.preferredContentSize = size
	}
	destNav.popoverPresentationController?.delegate = self
	if let colorSelectionController = destNav.visibleViewController as? EFColorSelectionViewController {
	    colorSelectionController.delegate = self
	    colorSelectionController.color = self.view.backgroundColor ?? UIColor.white

	    if UIUserInterfaceSizeClass.compact == self.traitCollection.horizontalSizeClass {
	        let doneBtn: UIBarButtonItem = UIBarButtonItem(
	            title: NSLocalizedString("Done", comment: ""),
	            style: UIBarButtonItemStyle.done,
	            target: self,
	            action: #selector(ef_dismissViewController(sender:))
	        )
	        colorSelectionController.navigationItem.rightBarButtonItem = doneBtn
	    }
	}
}

You can control the visibility of color textField by change the isColorTextFieldHidden property of EFColorSelectionViewController, for example:

isColorTextFieldHidden: true isColorTextFieldHidden: false

For more detail, please see the demo.

  1. Last but not the least, you should implement EFColorSelectionViewControllerDelegate so you can sense the color changes:
// MARK:- EFColorSelectionViewControllerDelegate
func colorViewController(colorViewCntroller: EFColorSelectionViewController, didChangeColor color: UIColor) {
    self.view.backgroundColor = color

    // TODO: You can do something here when color changed.
    print("New color: " + color.debugDescription)
}

Apps using EFColorPicker

Author

EyreFree, [email protected]

License

EFColorPicker is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].