Code Monkey home page Code Monkey logo

rscolorpicker's People

Contributors

bguest avatar dblapps avatar dennisreimann avatar jallen avatar luxorules avatar rhwood avatar rsully avatar unixpickle 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rscolorpicker's Issues

Script release process

Right now to make a release a few things need to happen:

  • Update podspec to new tag/version
  • Update screenshots
  • Make commit for "prep"
  • Tag commit with version
  • Release on github

`setCropToCircle:` needs to be called

Without setCropToCircle: being set, various methods like validPointForTouch: get confused because _activeAreaShape is nil. This method should not be necessary (i.e. there should be a default value).

Opacity of selection circle is displayed incorrectly

Because of how the selection circle is rendered, the color selected ends up layering itself and making the spot you have selected darker than the surrounding picker. This does not affect the color returned via delegates/etc, but is a visual issue.

`setSelectionColor:` cannot be called immediately

After initializing an RSColorPickerView, I would expect to be able to immediately call setSelectionColor:. However, calling this has no effect until after the picker view has received a didMoveToWindow call.

sizing problem

width is set to equal to height, not able to use use for different size (200 width and 300 height)

Fix NSOperation subclass

After digging into NSOperations again it looks like I implemented it incorrectly here. Based on what I've read, there is no need for -isConcurrent, -isExecuting, and -isFinished to be implemented as our operation should be non-concurrent, whereas the queue is what handles concurrency.

setSelectionColor Issues

The implementation for setSelectionColor seems hit-or-miss. For instance:

self.colorPicker.selectionColor = [UIColor blueColor]; //works
self.colorPicker.selectionColor = [UIColor yellowColor]; //works
self.colorPicker.selectionColor = [UIColor blackColor]; //selects green
self.colorPicker.selectionColor = [UIColor redColor]; //crashes the app

Completely fails with Interface Builder

Apple broke their own rules when writing UIKit - you have assumed they will call the method:

initWithFrame:

...which they are required to. However, Apple never ever calls this method when NIB files exist.

Also, your implementation requires the frame to exist - but Apple does not provide a valid frame when loading from NIB.

So:

  1. move all the code from initWithFrame into a new method - e.g. "initInternal"
  2. initWithFrame should call [self initInternal];
  3. add an -(void) awakeFromNib method, which should also (only) call [self initInternal];

If you do this, it works fine. If you don't, it will never work in a project that uses NIBs.

Image Color Pick issue

Hi, When i pass a image in rscolorpicker I am not getting any change in UI and response

'ANImageBitmapRep.h' file not found error

I'm trying to integrate the latest version of this library, and running into the error above. This may be related to using this as a cocoapod.

I tried creating a new project, including just this pod, and just including RSColorPickerView.h, and end up with the error shown in the attached screenshot.
screen shot 2014-04-11 at 3 43 57 pm

Invalid context 0x0. This is a serious error.

Hi,

I've been using RSColorPicker in my app for a while.

I just updated to XCode51-DP2 and the 7.1 beta and I am getting the errors below when I access RSColorPicker in my app.

Just to be sure I ran the standalone RSColorPicker example project and I also got the same errors.

RSColorPicker[20655] : CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
RSColorPicker[20655] : clip: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

These errors seem to prevent the app from continuing.

jb

Fix for pinning the point to inside the circle

RSColorPicker.m has a bug on line 263. The cropToCircle test is flipped. It currently reads:

-(CGPoint)validPointForTouch:(CGPoint)touchPoint {
    if (!cropToCircle) {
        //Constrain point to inside of bounds
        ...

And it should instead be:

-(CGPoint)validPointForTouch:(CGPoint)touchPoint {
    if (cropToCircle) {
        //Constrain point to inside of bounds
        ...

Thanks for the great project!

'ANImageBitmapRep.h' file not found in cocoa pods installation

After installing RSColorPicker with cocoapods , a fatal error is generated due the compiler being unable to find the ANImageBitmapRep.h file. Investigating further I verified that ANImageBitmapRep.h is present in the BuildHeaders directory as shown below:

30> pwd
/Users/bromo/my_app/Pods/BuildHeaders/RSColorPicker
 31> ls -l ANImageBitmapRep.h 
lrwxr-xr-x  1 bromo  501    88B Feb 26 00:34 ANImageBitmapRep.h@ -> ../../RSColorPicker/RSColorPicker/ColorPickerClasses/ANImageBitmapRep/ANImageBitmapRep.h
 32> ls -l ../../RSColorPicker/RSColorPicker/ColorPickerClasses/ANImageBitmapRep/ANImageBitmapRep.h
-rw-r--r--  1 bromo  501   2.9K Feb 26 00:34 ../../RSColorPicker/RSColorPicker/ColorPickerClasses/ANImageBitmapRep/ANImageBitmapRep.h
Lindas-iMacCoreDuo 33> 

I looked at the the include file search paths and noticed that -isystem and -iquotes options to clang are incorrect causing ANImageBitmapRep.h not to be found. Here are the incorrect options from the command line.

-isystem/Users/bromo/myapp/Pods/Headers
-isystem/Users/bromo/myapp/Pods/Headers/RSColorPicker
-iquotePods/Headers
-iquotePods/Headers/RSColorPicke

The isystem and iquote options are keyword options so they required a space between the keyword and the path argument. I am under the impression that absolute paths are required so the relative path specified for the quote options are incorrect as well.

Here is log entry for the failing compile:

CompileC /Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/Objects-normal/i386/TTTallyViewController.o Tennis\ Tally/TTTallyViewController.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd "/Users/bromo/SWDevelopment/iOS/ICare/Tennis Tally"
    setenv LANG en_US.US-ASCII
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wno-bool-conversion -Wenum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DCOCOAPODS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -fexceptions -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -mios-simulator-version-min=7.0 -iquote /Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/Tennis\ Tally-generated-files.hmap -I/Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/Tennis\ Tally-own-target-headers.hmap -I/Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/Tennis\ Tally-all-target-headers.hmap -iquote /Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/Tennis\ Tally-project-headers.hmap -iquotePods/Headers -iquotePods/Headers/RSColorPicker -I/Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Products/Debug-iphonesimulator/include -I/Users/bromo/SWDevelopment/iOS/ICare/Tennis\ Tally/Pods/Headers -I/Users/bromo/SWDevelopment/iOS/ICare/Tennis\ Tally/Pods/Headers/RSColorPicker -I/Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/DerivedSources/i386 -I/Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/DerivedSources -fdiagnostics-show-option -Wall -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wformat=2 -Wimplicit-atomic-properties -Wmissing-declarations -Wmissing-prototypes -Woverlength-strings -Wshadow -Wstrict-selector-match -Wundeclared-selector -Wunreachable-code -Wno-unused-parameter -F/Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Products/Debug-iphonesimulator -isystem/Users/bromo/SWDevelopment/iOS/ICare/Tennis\ Tally/Pods/Headers -isystem/Users/bromo/SWDevelopment/iOS/ICare/Tennis\ Tally/Pods/Headers/RSColorPicker -include /Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/PrecompiledHeaders/Tennis\ Tally-Prefix-ckhjlxjsrlidtvdtzlbsqnznyzfj/Tennis\ Tally-Prefix.pch -MMD -MT dependencies -MF /Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/Objects-normal/i386/TTTallyViewController.d --serialize-diagnostics /Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/Objects-normal/i386/TTTallyViewController.dia -c /Users/bromo/SWDevelopment/iOS/ICare/Tennis\ Tally/Tennis\ Tally/TTTallyViewController.m -o /Users/bromo/Library/Developer/Xcode/DerivedData/Tennis_Tally-eddfuwlvfcrrhdfnoloifwpzxowc/Build/Intermediates/Tennis\ Tally.build/Debug-iphonesimulator/Tennis\ Tally.build/Objects-normal/i386/TTTallyViewController.o

In file included from /Users/bromo/SWDevelopment/iOS/ICare/Tennis Tally/Tennis Tally/TTTallyViewController.m:9:
In file included from /Users/bromo/SWDevelopment/iOS/ICare/Tennis Tally/Tennis Tally/TTTallyViewController.h:10:
/Users/bromo/SWDevelopment/iOS/ICare/Tennis Tally/Pods/Headers/RSColorPicker/RSColorPickerView.h:11:9: fatal error: 'ANImageBitmapRep.h' file not found
#import "ANImageBitmapRep.h"
        ^
1 error generated.

Update podspec to 0.8.1

It would be great if the podspec could be updated to 0.8.1 so I can get this release using CocoaPods.

Show color outside cirlce

I have an strange issue using this awesome control. when select color exactly from top right corner then color spread outside of circle
simulator screen shot nov 22 2016 3 36 40 pm

I create a separate demo app

  • demo is in landscape
  • app is in swift (I am using bridging )
  • xcode 8.0
  • facing same on simulator and in real device

Consider switching to MIT license

If anyone has any thoughts I'd be open to a discussion. I skimmed through the differences on tldr;legal: my takeaway is they are pretty similar.

Readme needs clarification

The read me could be expanded a bit in some of the following ways:

  • Make delegation more obvious
  • Clarify that the main view is only the color picker, and that that you're not forced to use the badly laid out example controller (I'm afraid people might look at the screenshots and be turned away)
    • Update example project for better layout/etc ๐Ÿ˜‰ (also see #34)
    • Make custom sliders less obvious - not really meant to be used

Selectioncolor issue

I want to pass color to RSColorPicker and want to select the corresponding color... it works for the colors
for present BRIGHTNESS slider value or colors which are presently showing in color picker view, lets say user passes BLACK color to it, selects GREEN ... How could i set brightness corresponding to color passed or calculate the brightness for passed color and set it, Any ideas or fixes then please suggest ... ?

Could not find ANImageBitmapRep.h

When I import this framework into my project using CocoaPods, in file RSColorPickerView.h Xcode seems that can't find the file ANImageBitmapRep.h
The error is:
(project directory)/Pods/Headers/RSColorPicker/RSColorPickerView.h:12:9: 'ANImageBitmapRep.h' file not found
I use Xcode 5.0.1 on Mavericks, testing on iOS 7.0.3 (64-bit)

Podspec invalid

The current podspec is invalid so cannot be included in the repo...

daniels-imac:RSColorPicker-0.8.1 Daniel$ cd "/Users/Daniel/Downloads/RSColorPicker-master"
daniels-imac:RSColorPicker-master Daniel$ pod spec lint

-> RSColorPicker (0.8.1)
- ERROR | [iOS] [xcodebuild] RSColorPicker/RSColorPicker/ColorPickerClasses/BGRSLoupeLayer.m:33:9: fatal error: 'RSOpacitySlider.h' file not found

Analyzed 1 podspec.

[!] The spec did not pass validation.

xib issue

Hi,I use RSColorPickerView in xib.As soon as I add constraint,but the RSColorPickerView's gradient layer did not update.It still show the xib's frame's content not actual frame's content.(Look,it should be show the black frame's content.)
2016-10-07 2 07 19

Setting color to outside circle with cropToCircle = NO doesn't work

This seems like a bug to me. Basically, it is impossible to set the color of the picker to any value that lies in the corners of the square (cropToCircle = NO).

Example, pick a color with the picker. For example, this one http://cl.ly/RQ7g
This is 1.000000 0.000000 0.752941 1.000000 (RGB A). Now do a
[_colorPicker setSelectionColor:[UIColor colorWithRed:1 green:0 blue:0.752941 alpha:1]];

The result will be http://cl.ly/RQ15 which is a different color that lies exactly on the boundaries of the circle. This is not correct. If I set cropToCircle to NO, colors picked and set within the boundaries of the square not the circle should work.

Slider Performance is Terrible on iPad

When sliding on iPad it takes several seconds to refresh. Same goes for getting the view to show initially. Most likely due to making a sqrt call for every pixel...

Update test project to iOS 7

Once the iOS 7 SDK is publicly released it would be a good idea to go through the test project and see what needs updating.

It also might be a good idea to look at the API changes and see if there are any new things we could take advantage of.

Missing files in CocoaPods

I downloaded the source code for my project and works perfectly, but when I change to use cocoapods, I found that 'RSBrightnessSlider' is MISSING!

One more problem, there is a build error, and its NOT the same with the source code, so I think you might forgot to update the pod?

Error private header:

#import "ANImageBitmapRep.h"

custom color

Can i change the color of the RSColorPickerView?
I don't want the color of the color, I want to custom colors

Persistent memory issue

When I continuously change the selection color, memory usage increase quickly.
With Instruments, I found that a lot of objects are created. They are persistent rather than transient. So the system won't recycle the allocated space.

How do I keep the memory usage stable?

screenshot 2015-11-19 11 29 16

screenshot 2015-11-19 11 30 14

screenshot 2015-11-19 11 30 44

screenshot 2015-11-19 11 31 08

Assertion failed when cropToCircle is set NO and color picker view's outside is touched

IMO, validPointForTouch: in RSColorPickerView.m should be fixed like this :

    -(CGPoint)validPointForTouch:(CGPoint)touchPoint {
        -   if (!cropToCircle) return touchPoint;
        +   if (!cropToCircle) 
            +    {
                +        if(touchPoint.x < 0)    touchPoint.x = 0;
                +        if(touchPoint.y < 0)    touchPoint.y = 0;
                +        if(touchPoint.x > self.frame.size.width)    touchPoint.x = self.frame.size.width-0.1;
                +        if(touchPoint.y > self.frame.size.height)   touchPoint.y = self.frame.size.height-0.1;
                +        return touchPoint;
                +    }

Custom image

Is it possible to use a custom image instead of the color picker view to pick colors?

Load performance pains

See issue #8 starting at this comment: #8 (comment)

-genBitmap is slow and causes the color picker to block the main thread during each initialization.


Prior discussion:

@simonbs:

I'm sorry for jumping into the discussion like this but I'm very interested in hearing if anyone have figured out a way to improve the performance when loading the color picker? It gives me a very bad performance on my iPhone 5 so when pushing a view which contains the control onto my navigation stack, it does so without any animation. However, it seems that when the control has been loaded, the performance is really great.

@stuartjmoore:

I'm guessing the load slowdown is due to the loops and calculations in genBitmap. There's no need to generate a gradient background every single time (since the color wheel will likely never resize), so I'm to experiment with a static background from a screenshot.

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.