GithubHelp home page GithubHelp logo

halechan / dkverticalcolorpicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davecom/dkverticalcolorpicker

0.0 1.0 0.0 328 KB

A simple iOS color picker presented as a vertical hue bar.

License: Other

Ruby 6.68% Objective-C 93.32%

dkverticalcolorpicker's Introduction

DKVerticalColorPicker

DKVerticalColorPicker is a simple iOS color picker presented as a vertical color bar from which the user can pick a color by its hue. Wings on either side of the color bar indicate the currently selected color. A small subclass of UIView, it is useful for simple applications - places where picking saturation, brightness, and alpha don't matter. It is similar in design to the color picker used in SnapChat's photo capture screen.

DKVerticalColorPicker

Features

  • Resizable/little space usage - set DKVerticalColorPicker's frame to be whatever makes sense for your application
  • Reports color changes to a delegate
  • IBDesignable and IBInspectable - set the initial color in IB
  • Teeny tiny codebase with no dependencies

Installation

Simply copy DKVerticalColorPicker.m and DKVerticalColorPicker.h into your project or use the CocoaPod DKVerticalColorPicker.

Usage

You can drag a UIView out in IB and set its class as DKVerticalColorPicker or you can instantiate it in code via initWithFrame. Make it whatever size suits your app. Either way, you'll want to set its delegate property to a class that implements the protocol DKVerticalColorPickerDelegate.

DKVerticalColorPickerDelegate defines a single method colorPicked: which is triggered every time the picker's color changes (either via user interaction or after the selectedColor property is set in code).

You can set the color manually by simply setting the property selectedColor.

Tips

  • If you use DKVerticalColorPicker in IB, set its backgroundColor to ClearColor for things to look right.
  • If you change selectedColor programatically, note that the delegate will be notified of a color change

License and Authorship

Released under the MIT License. Copyright 2015 David Kopec. Please open issues on GitHub.

dkverticalcolorpicker's People

Contributors

davecom avatar

Watchers

Hale Chan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.