Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
swift_library(
name = "HexColor",
module_name = "HexColor",
srcs = glob([
"Sources/**/*.swift",
]),
copts = [
"-warnings-as-errors",
],
deps = [
"//submodules/TextFormat:TextFormat",
],
visibility = [
"//visibility:public",
],
)
@@ -0,0 +1,16 @@
import Foundation
import UIKit
import TextFormat
public extension UIColor {
var hexString: String {
var red: CGFloat = 0.0
var green: CGFloat = 0.0
var blue: CGFloat = 0.0
self.getRed(&red, green: &green, blue: &blue, alpha: nil)
let rgb: UInt32 = (UInt32(red * 255.0) << 16) | (UInt32(green * 255.0) << 8) | (UInt32(blue * 255.0))
return String(rgb, radix: 16, uppercase: false).rightJustified(width: 6, pad: "0")
}
}