Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #23 from KeenenCharles/master
Browse files Browse the repository at this point in the history
Updated readme with completionHandler
  • Loading branch information
jathu committed Apr 17, 2016
2 parents 59b6612 + e5045f1 commit 4843cce
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ This is pretty simple to use:

```Swift
let image = UIImage(named: "hello.png")
let colors = image.getColors()

backgroundView.backgroundColor = colors.backgroundColor
mainLabel.textColor = colors.primaryColor
secondaryLabel.textColor = colors.secondaryColor
detailLabel.textColor = colors.detailColor
image.getColors({ (colors) in
backgroundView.backgroundColor = colors.backgroundColor
mainLabel.textColor = colors.primaryColor
secondaryLabel.textColor = colors.secondaryColor
detailLabel.textColor = colors.detailColor
})

```

## UIImage Methods

- **getColors(scaleDownSize: CGSize) -> UIImageColors**
- **getColors(scaleDownSize: CGSize, completionHandler: (UIImageColors) -> Void)**

Get an UIImageColors struct from the image. Use smaller sizes for better performance at the cost of quality colors. Use larger sizes for better color sampling and quality at the cost of performance.
Get an UIImageColors struct from the image. Use smaller sizes for better performance at the cost of quality colors. Use larger sizes for better color sampling and quality at the cost of performance.

- **getColors() -> UIImageColors**
- **getColors(completionHandler: (UIImageColors) -> Void)**

Get an UIImageColors struct from the image. The default image scale down is 250px width, and the aspect ratio height.

Expand Down

0 comments on commit 4843cce

Please sign in to comment.