Skip to content

Instantly share code, notes, and snippets.

Avatar

Henngel Mojica henngelm

View GitHub Profile
@henngelm
henngelm / generateRandomColor.swift
Created Feb 17, 2018
Generating random UIColor in Swift
View generateRandomColor.swift
// returns a random color
func randomColor() -> UIColor {
let red = CGFloat(drand48())
let green = CGFloat(drand48())
let blue = CGFloat(drand48())
return UIColor(red: red, green: green, blue: blue, alpha: 1.0)
}