Skip to content

Commit

Permalink
Fix warning (#2453)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Jan 3, 2025
1 parent 8872dc0 commit 4679929
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DcCore/DcCore/Extensions/UIColor+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public extension UIColor {
// see: https://stackoverflow.com/a/33397427
convenience init(hexString: String) {
let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int = UInt32()
Scanner(string: hex).scanHexInt32(&int)
let a, r, g, b: UInt32
var int = UInt64()
Scanner(string: hex).scanHexInt64(&int)
let a, r, g, b: UInt64
switch hex.count {
case 3: // RGB (12-bit)
(a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
Expand Down

0 comments on commit 4679929

Please sign in to comment.