Skip to content

Commit

Permalink
Initial realease
Browse files Browse the repository at this point in the history
  • Loading branch information
NorthernRealities committed Mar 20, 2015
1 parent eac8814 commit 2e554b9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions UIColor+Creater.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// UIColor+Creater.swift
// Rainbow UIColor Extension
//
// Created by Reid Gravelle on 2015-03-18.
// Copyright (c) 2015 Northern Realities Inc. All rights reserved.
//

import UIKit


extension UIColor {
/**
Returns a color object representing the color with the given RGB component values and has the specified opacity.
:param: red The red component of the color object, specified as a value between 0 and 255.
:param: green The green component of the color object, specified as a value between 0 and 255.
:param: blue The blue component of the color object, specified as a value between 0 and 255.
:param: alpha A CGFloat between 0.0 and 1.0 representing the opacity with a default value of 1.0.
:returns: The UIColor object
*/

class func createColorWith ( #red: Int, green: Int, blue: Int, alpha: CGFloat = 1.0 ) -> UIColor {
return UIColor (
red: CGFloat ( red ) / 255.0,
green: CGFloat ( green ) / 255.0,
blue: CGFloat ( blue ) / 255.0,
alpha: alpha )
}
}

0 comments on commit 2e554b9

Please sign in to comment.