Skip to content

paulemmanuel-garcia/RVSColorPicker

Repository files navigation

RVSColorPicker

Build Status CocoaPods Carthage compatible CocoaPods CocoaPods

RVSColorPicker is a toolbox to generate and pick color easily with Objective-c or Swift.

Installation

RVSColorPicker can be installed with CocoaPods. To install it, add pod "RVSColorPicker" to your Podfile.

RVSColorPicker is also Carthage compatible. You just need to add github "paulemmanuel-garcia/RVSColorPicker" to your Cartfile.

Usage

Import

To use it on your project you need to import the framework.

// Objective-c
#import "RVSColorPicker.h";
// Swift
import RVSColorPicker

Use Generated Colors

You can use it to generate one random color or a palette of random colors. Furthermore, RVSColorPicker can generate specific color for white text written on it. You can exclude colors to avoid them during color generation.

Use a random color.
// Objective-c
UIColor *generatedColor = [RVSColorGenerator color];
// Swift
let generatedColor = ColorGenerator.color()
Use a random color for white text.
// Objective-c
UIColor *generatedColor = [RVSColorGenerator colorForWhiteText];
// Swift
let generatedColor = ColorGenerator.colorForWhiteText()
Use a random colors palette
// Objective-c
NSArray<UIColor *> *generatedColor = [RVSColorGenerator colorsWithCount:15];
// Swift
let generatedColor = ColorGenerator.colors(with: 5)
Use a random colors palette and exclude colors
// Objective-c
NSArray<UIColor *> *excludedColors = @[[UIColor colorWithHue:0.9], [UIColor colorWithHue:0.91], /* ... */[UIColor colorWithHue:1]];
NSArray<UIColor *> *generatedColor = [RVSColorGenerator colorsWithCount:15 withExcludedColors:excludedColors];
// Swift
let excludedColors = [Color(withHue:0.9), /* ... */, Color(withHue:1.0)]
let generatedColor = ColorGenerator.colors(with: 15, excluded:excludedColors)

What's next

  • More choice for color generation (saturation, brightness)
  • Color association
  • A real (UI) Color Picker

Documentation

License

RVSColorPicker is available under the MIT license. See the LICENSE file for more info.

About

RVSColorPicker is a toolbox to generate and pick color easily for Objective-c or Swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published