https://github.com/bbqsrc/itdavatarplaceholder
Library to generate the user avatar placeholder image (iOS)
https://github.com/bbqsrc/itdavatarplaceholder
Last synced: 12 months ago
JSON representation
Library to generate the user avatar placeholder image (iOS)
- Host: GitHub
- URL: https://github.com/bbqsrc/itdavatarplaceholder
- Owner: bbqsrc
- License: mit
- Created: 2016-09-08T23:22:21.000Z (over 9 years ago)
- Default Branch: develop
- Last Pushed: 2017-01-13T03:45:03.000Z (about 9 years ago)
- Last Synced: 2024-12-31T21:11:59.660Z (about 1 year ago)
- Language: Swift
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ITDAvatarPlaceholder
[](https://travis-ci.org/Igor Kurylenko/ITDAvatarPlaceholder)
[](http://cocoapods.org/pods/ITDAvatarPlaceholder)
[](http://cocoapods.org/pods/ITDAvatarPlaceholder)
[](http://cocoapods.org/pods/ITDAvatarPlaceholder)
Generates an avatar placeholder image with first letters of the provided full user name in the center.

This library uses [Chameleon](https://github.com/ViccAlexander/Chameleon) (Flat Color Framework for iOS) for
a background color generation. Moreover a color of the background is computed from a hash of the provided
user name.
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
To create the 256x256 placeholder image:
```swift
let avatarPlaceholderImage = UIImage.createAvatarPlaceholder(
userFullName: "Erlich Bachman", placeholderSize: CGSizeMake(256, 256))
```
## Installation
ITDAvatarPlaceholder is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "ITDAvatarPlaceholder"
```
## Author
Igor Kurylenko, igorkurylenko@gmail.com
## License
ITDAvatarPlaceholder is available under the MIT license. See the LICENSE file for more info.