sgl0v / mscolorpicker Goto Github PK
View Code? Open in Web Editor NEWColor picker component for iOS
License: MIT License
Color picker component for iOS
License: MIT License
I receive this error when trying to build MSColorPickerDemo...
ld: warning: directory not found for option '-L/Users/deanharvey/Library/Developer/Xcode/DerivedData/MSColorPickerDemo-hgwelnkhjvtfrkalwqmarpmcsqwh/Build/Products/Debug-iphonesimulator/MSColorPicker'
ld: library not found for -lMSColorPicker
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Demo works though.
- (IBAction)changeColor:(id)sender {
MSColorSelectionViewController *controller = [[MSColorSelectionViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:controller];
UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Done", ) style:UIBarButtonItemStyleDone target:self action:@selector(dismissColorPicker:)];
controller.navigationItem.rightBarButtonItem = doneBtn;
controller.delegate = self;
controller.color = self.view.tintColor;
[self presentViewController:navigationController animated:YES completion:nil];
}
- (void)dismissColorPicker:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)colorViewController:(MSColorSelectionViewController *)colorViewCntroller didChangeColor:(UIColor *)color {
self.view.window.tintColor = color;
colorViewCntroller.view.window.tintColor = color;
}
Hi
I see that this has been reported before and resolved, but when attempting to compile the Demo project I get the following linker issue;
ld: warning: directory not found for option '-L/Users/Paul/Library/Developer/Xcode/DerivedData/MSColorPickerDemo-aepbaxofjcjllwdxkjhethtpzksr/Build/Products/Debug-iphonesimulator/MSColorPicker'
ld: library not found for -lMSColorPicker
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And suggestions on how to resolve? Thanks.
Paul
I made a swift version of MSColorPicker - EFColorPicker, and thanks for your work.
diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I tried to get an image from an UInt8 arrary of RGBA, but i didn't get any useful method of how to covert it, until found soluton in your code.
Here is my code in swift3.0, hope that can help anyone else who meets the same problem.
Thanks!
func imageRefFromBitmap() {
// CFData
let size: (width: Int, height: Int) = (200, 150)
let bitmapData = CFDataCreateMutable(nil, 0)
CFDataSetLength(bitmapData, size.width * size.height * 4)
// BytePtr
let bitmap = CFDataGetMutableBytePtr(bitmapData)
// RGBA, 0~255
for i in 0..<size.height {
for j in 0..<size.width {
let k = 4 * (j + i * size.height)
bitmap?[k+0] = 255 // red
bitmap?[k+1] = 0 // green
bitmap?[k+2] = 0 // blue
bitmap?[k+3] = 255 // alpha
}
}
// CGImage
let provider = CGDataProvider.init(data: bitmapData!)
let imageRef = CGImage.init(width: size.width, height: size.height, bitsPerComponent: 8, bitsPerPixel: 4 * 8, bytesPerRow: 4 * size.width, space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: [CGBitmapInfo.byteOrderMask, CGBitmapInfo.init(rawValue: CGImageAlphaInfo.premultipliedLast.rawValue)], provider: provider!, decode: nil, shouldInterpolate: false, intent: CGColorRenderingIntent.defaultIntent)
// In my case, self is an instance of UIView, it works fine
layer.contents = imageRef
}
The MSColorPicker is so good, but i need to use the color wheel. Is possible? For example, i have a a view in my view controller, and need to put the wheel is the view.
I hope you should can respond me. Regards.
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.