-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29a9b8d
commit 258b31a
Showing
6 changed files
with
47 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+165 Bytes
(100%)
....xcodeproj/project.xcworkspace/xcuserdata/nino.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// UIColor+Extension.swift | ||
// Gamester | ||
// | ||
// Created by Nino on 01.04.2024.. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIColor { | ||
convenience init(hex: String, alpha: CGFloat = 1.0) { | ||
var formattedHex = hex | ||
if hex.hasPrefix("#") { | ||
formattedHex = String(hex.dropFirst()) | ||
} | ||
|
||
var rgbValue: UInt64 = 0 | ||
Scanner(string: formattedHex).scanHexInt64(&rgbValue) | ||
|
||
let red = CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0 | ||
let green = CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0 | ||
let blue = CGFloat(rgbValue & 0x0000FF) / 255.0 | ||
|
||
self.init(red: red, green: green, blue: blue, alpha: alpha) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters