Giter Site home page Giter Site logo

ios-color-wheel's Introduction

ios-color-wheel

About

A fully scalable and dynamically rendered color picker for iOS.

Many other iOS color pickers work by sampling colors from a pre-rendered image of a color wheel. This approach limits the color picker to the size and quality of the static image. This project contains a color wheel that computes color values mathematically, and renders dynamically, giving a completely scalable UIView and more accurate color selection.

Technical

Color wheels visualize and define colors from hue, saturation, and brightness components (HSB color space). On the wheel, two of these components can be mapped to two-dimensional polar coordinates. Hue is defined by the angle on the wheel. Saturation is defined by the distance from the center. Brightness, the third component cannot also be mapped to the two dimensional surface so it must be controlled by a separate control such as a slider.

Includes

  • Standalone ISColorWheel class (UIView subclass)
  • Example project

sample image

ios-color-wheel's People

Contributors

dimensionerror avatar justinmeiners avatar valeriyvan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ios-color-wheel's Issues

Set a color to Color Wheel

I have rgb slider, and I need to update the Color Wheel with a new color, but your class not have method to update color, or has it? Thanks for the class, is amazing.

License

Hello there!

Would you be up for putting a license in your repo?

Cheers,
Marcus

colorWheelDidChangeColor doesn't work in swift

Hello

Coud you please help how to implement the colorWheelDidChangeColor method in swift 2?
How do i set the delegate to self? That doesn't work: cw!.delegate = self

I tried it with this code:

var cw: ISColorWheel?
cw = ISColorWheel(frame:CGRectMake(size!.width / 2 - wheelSize!.width / 2, size!.height * 0.1, wheelSize!.width, wheelSize!.height))
cw!.continuous = true
self.view.addSubview(cw!)

And the action method:

func colorWheelDidChangeColor(colorWheel: ISColorWheel) {
view.backgroundColor = colorWheel.currentColor()
}

Thank you for your help.

Simon

Set pick point (set the current color)

Is there an easy way to set the pick point (current color)
colorWheel.setCurrentColor(UIColor.greenColor()) //I am working is swift
This give me a very artistic color wheel.

Rotate wheel

Hi,

This is a great color wheel implementation!

One thing I would like to do is rotate the wheel so the red hues are at the top. How can that be done please? (I assume simply applying a transform will result in incorrect colors being returned as the users pans across the wheel)

Float Architecture Problem

In the function setCurrentColor:, the hue, saturation, brightness, and alpha values are initialized as floats, instead of the CGFloats that the getHue: saturation: brightness: alpha: function accepts. This should be changed, as depending on the architecture CGFloats might not be a float (could be a double, for example). This will get the returned values as completely wrong (I was seeing 1.87 and whatnot when I discovered this, which caused the color wheel to look somewhat cool but totally incorrect).

Changing the types to CGFloats fixes this problem.

TEst

  • Create Swift Version
  • Fix floating point problems
  • AwakeFromNib

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.