hayashi311 / color-picker-for-ios Goto Github PK
View Code? Open in Web Editor NEWColorful: iOS color picker built with Swift.
License: Other
Colorful: iOS color picker built with Swift.
License: Other
does not compile for ARC (auto reference counting) projects
is there a ARC version somewhere ?
The version I just obtained using cocoa pods has some bugs that are fixed in your current master. For example, programmatically setting the color doesn't have any effect on the views in the pods version, but in your master branch, it has been fixed and does have the expected effect.
When I run it, I get the following error:
[!] An error occurred while processing the post-install hook of the Podfile.
undefined method `project' for #<Pod::Installer:0x007f86f39fef80>
I have had to make this change to avoid my app crashing
Line 191:
if (brightnessCursorX < 0 || isnan(brightnessCursorX)) {
return;
}
(Added NaN check). The problem occurs during setting the color for refreshing the view with new data, via an async queue.
Oh, this was already fixed a few days ago.
Originally posted by @xaphod in #39 (comment)
Can you include better directions for customizing UI and using it with Autolayout? The various delegate methods and what needs to be implemented is not well-documented and prevents people from using the framework beyond the default.
The SPM doesn't support Xcode 12
Showing All Messages
https://github.com/hayashi311/Color-Picker-for-iOS has no Package.swift manifest for version 3.0.0
How can I use this in Swift project?
I have added using Cocoapods but I am getting "No such module" error.
Main Thread Checker: UI API called on a background thread: -[UIView frame]
PID: 58164, TID: 12541840, Thread name: (none), Queue name: NSOperationQueue 0x60c00003e000 (QOS: UNSPECIFIED), QoS: 0
Backtrace:
4 ipgmail 0x000000010eba6d91 -[HRColorMapView createColorMapLayer] + 145
5 ipgmail 0x000000010eba60ea __23-[HRColorMapView _init]_block_invoke + 42
6 Foundation 0x00000001119899b7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
7 Foundation 0x000000011198981a -[NSBlockOperation main] + 68
8 Foundation 0x0000000111987cd6 -[__NSOperationInternal _start:] + 778
9 libdispatch.dylib 0x000000011728643c _dispatch_client_callout + 8
10 libdispatch.dylib 0x000000011728baf4 _dispatch_block_invoke_direct + 592
11 libdispatch.dylib 0x000000011728643c _dispatch_client_callout + 8
12 libdispatch.dylib 0x000000011728baf4 _dispatch_block_invoke_direct + 592
13 libdispatch.dylib 0x000000011728b884 dispatch_block_perform + 109
14 Foundation 0x0000000111983ce4 __NSOQSchedule_f + 342
15 libdispatch.dylib 0x000000011728643c _dispatch_client_callout + 8
16 libdispatch.dylib 0x000000011728c856 _dispatch_continuation_pop + 967
17 libdispatch.dylib 0x000000011728ac86 _dispatch_async_redirect_invoke + 780
18 libdispatch.dylib 0x00000001172921f9 _dispatch_root_queue_drain + 772
19 libdispatch.dylib 0x0000000117291e97 _dispatch_worker_thread3 + 132
20 libsystem_pthread.dylib 0x00000001177471ca _pthread_wqthread + 1387
21 libsystem_pthread.dylib 0x0000000117746c4d start_wqthread + 13
Not easy to pick white color
It looks a lot better. I've added this to my current project. Played around with all the animation duration, this works the best.
(void)updateCursor {
CGFloat brightnessCursorX = (1.0f - (self.brightness.floatValue - self.brightnessLowerLimit.floatValue) / (1.0f - self.brightnessLowerLimit.floatValue));
if (brightnessCursorX < 0) {
return;
}
CGPoint point = CGPointMake(brightnessCursorX * _controlFrame.size.width + _controlFrame.origin.x, _brightnessCursor.center.y);
[UIView animateWithDuration:0.1
delay:0
options:UIViewAnimationOptionCurveEaseIn
animations:^
{
_brightnessCursor.center = point;
_brightnessCursor.color = self.color;
}
completion:^(BOOL finished)
{
}];
}
Probably 3.0.1 can be pushed to cocoapods repository
If I mention in Podfile, CocoaPods cannot find version
pod 'Colorful', '~> 3.0.1'
Testing this on my iPhone, I am only able to see red colors in the gradient of color options. I don't see green, yellow, blue, or any of the other colors that appear in the image.
Oddly enough, a similar issue occurred for me while using another color picker library.
Do you have any idea why this is happening?
follow the step of README
colorMapView can not show
HRBrightnessSlider can show
HRColorInfoView can show
what's wrong with my step?
For those of your having problems with wrong-spaced frames, just add the following code to your controller:
_colorPickerView.frame = CGRectMake(0.0f, 0.0f, self.view.frame.size.width, self.view.frame.size.height);
_colorPickerView.colorInfoView.frame = CGRectMake(8.0f, 8.0f, _colorPickerView.colorInfoView.frame.size.width, _colorPickerView.colorInfoView.frame.size.height);
_colorPickerView.colorMapView.frame = CGRectMake(84.0f, 80.0f, self.view.frame.size.width - 84.0f - 8.0f, _colorPickerView.colorMapView.frame.size.height);
_colorPickerView.brightnessSlider.frame = CGRectMake(0.0f, 104.0f, self.view.frame.size.width, self.view.frame.size.height - 104.0f);
I use Color-Picker-for-iOS by storyboard and do implement - (void)viewWillAppear:(BOOL)animated but it doesn't work.Every time I segue to the scene colorpickerview always show the default color(redcolor,the upper left corner of the square).
@implementation LLColorPickerController
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.colorPickerView.color = [UIColor blueColor];//self.color;
}
I like the color picker. But unfortunately, it is NOT easy to get a white color on there. Its frustrating. I can't seem to get the white color for the background. Since white & black are the main colors that users will use as the background, so I think changing color picker will be needed here.
Do you have any recommendations ?
Thanks.
i want to adjust view based on number of tiles to be displayed in a view, because the number of tiles is not fixed it changes as per device
so is there any way to get number of tiles.
In my scenario I want to get color name after selected the color in color pad, Because in Xcode already one property is available to get the color name using "accessibilityName" word. But this is giving me a color name, After searching on google with that color name it gives different one.
Hi,
Like Title , I Use Color Picker Without Interface Builder .
And Set saturationUpperLimit.
colorPickerView.colorMapView.saturationUpperLimit = @1;
And How To Use FullColor Without Interface Builder ?
Thank you to answer.
Casting your hex values on info view is loosing some precision, here is the updated method:
CGFloat rFloat, gFloat, bFloat, aFloat;
[self getRed:&rFloat green:&gFloat blue:&bFloat alpha:&aFloat];
int r, g, b;
r = (int)ceilf(255.0 * rFloat);
g = (int)ceilf(255.0 * gFloat);
b = (int)ceilf(255.0 * bFloat);
return [NSString stringWithFormat:@"#%02x%02x%02x", r, g, b];
how to write Podfile?
like this maybe?
platform :ios, '7.0'
pod 'Color-Picker-for-iOS', '~> 0.1.1'
Is 0.1.1 the latest version?
HRColorMapView.m
[_initializeQueue addOperationWithBlock:^{
[self createColorMapLayer]; ---------------> this code may be have problem.
dispatch_async(dispatch_get_main_queue(), ^{
(2) ------------> maybe code here , there will run on main thread
I did install the library from pod and followed the sample code.
View can't be shown, because colorPickerView frame is 0,0,0,0 !
Please fix
Roberto
Also, what about a "close" button to dismiss colorPickerView ?
When changing from portrait to landscape, colorMapView remains in it's portrait layout. Any fix for that?
Thanks.
The HRColorPickerView always returns black. When I move the slider I can see it is purple, but the brightness is always set to 0 on init. I have set it up just like the example project.
Do you have any plans to modify this to support the iPad as well?
It would be great if you added support for the Carthage package manager
Your Color Picker is very easy to use to compare others. But I want to use only circle colour picker, I have a UIView in that view I want to display this circle Color Picker in centre with out slider (beside the circle color picker). Is it possible? If yes please guide me.
In ColorPicker class I tried to hide addSubview(brightnessSlider) and addSubview(colorMapCursor) in private func setup() . But it is not working.
For example see my image, I want total view like this...
Here I wan to remove slider completely and adjust the color circle in to centre of the view (OR) at least hide slider and adjust the color circle in to centre of the screen.
And how to stop continuous reading values from ColorPicker? Which means I want to call this handleColorChanged function only one time that is last value. Because of I want to call one more function in to this.
Thank you.
It would be great if you added Swift support
Getting crash due to hsvColor { preconditionFailure() }()
Please support orientation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.