https://github.com/polidea/plxcolors
Objective-C library to create UIColor/NSColor objects based on the HEX color representation.
https://github.com/polidea/plxcolors
Last synced: 12 months ago
JSON representation
Objective-C library to create UIColor/NSColor objects based on the HEX color representation.
- Host: GitHub
- URL: https://github.com/polidea/plxcolors
- Owner: Polidea
- License: mit
- Created: 2015-11-06T10:43:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-06T12:31:08.000Z (over 10 years ago)
- Last Synced: 2025-02-11T17:01:51.143Z (over 1 year ago)
- Language: Objective-C
- Size: 0 Bytes
- Stars: 1
- Watchers: 18
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PLXColors
[](https://travis-ci.org/Polidea/PLXColors)
[](http://cocoadocs.org/docsets/PLXColors)
[](http://cocoadocs.org/docsets/PLXColors)
[](http://cocoadocs.org/docsets/PLXColors)
PLXColors is a small library that allows you to create UIColor or NSColor objects based on the hexadecimal representation of the
colors, similar to that used in HTML and CSS languages. UIKit/AppKit allows you to create UIColor/NSColor objects only with floating
point numbers which is inconvenient when you get these values from graphics programs.
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
### Methods
PLXColors provides four methods to create UIColor or NSColor objects:
```objc
+ (PLColor *)colorWithHexString:(NSString *)hexString;
+ (PLColor *)colorWithHexStringWithAlpha:(NSString *)hexString;
+ (PLColor *)colorWithHexInteger:(NSUInteger)value;
+ (PLColor *)colorWithHexIntegerWithAlpha:(NSUInteger)value;
```
where PLColor is UIColor or NSColor class depends on target platform.
See the code or [Documentation](http://cocoadocs.org/docsets/PLXColors) to check in which format should be parameters.
## Requirements
- iOS6 or OS X 10.8
## Installation
PLXColors is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
pod "PLXColors"
## Author
Michał Laskowski, michal.laskowski@polidea.com
## License
PLXColors is available under the MIT license. See the LICENSE file for more info.