Code Monkey home page Code Monkey logo

mscolorpicker's Introduction

MSColorPicker

Build Status Version License Platform

[OverviewInstallationDemoRequirementsLicence]


Alt text Alt text

Overview

Color picker component for iOS. It allows the user to select a color with color components. Key features:

  • iPhone & iPad support,
  • Adaptive User Interface,
  • Supports RGB and HSB color models,
  • Well-documented,
  • Compatible with iOS 8.0 (iPhone & iPad) and higher.

Installation

MSColorPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MSColorPicker"

Demo

Build and run the MSColorPickerDemo project in Xcode. The demo shows how to use and integrate the MSColorPicker into your project.

Requirements

  • Requires iOS 8.0 or later
  • Requires Automatic Reference Counting (ARC)

Licence

MSColorPicker is MIT-licensed. See LICENSE.

mscolorpicker's People

Contributors

sgl0v 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

mscolorpicker's Issues

Use only the color wheel

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.

3 errors

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.

Returned color is always 100% transparent

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;
}

A solution of converting bitmap to ImageRef in swift3.0

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
    }

build error

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)

ld: library not found for -lMSColorPicker

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

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.