Making suggested changes

This commit is contained in:
Paulo Cesar Ferreira 2017-11-16 12:29:12 +01:00
parent 9fed645d0b
commit 8af423e8bf
1 changed files with 1 additions and 4 deletions

View File

@ -110,10 +110,7 @@ public extension DynamicColor {
*/
public final func toHex() -> UInt32 {
func roundToHex(_ x: CGFloat) -> UInt32 {
if x < 0 {
return UInt32(0)
}
guard x > 0 else { return 0 }
let rounded: CGFloat = round(x * 255)
return UInt32(rounded)