Forráskód Böngészése

添加可设置通道参数

jsonwang 3 éve
szülő
commit
9aefa30329

+ 2 - 2
BFFramework/Classes/BFModules/BFCategorys/BFColor+Ext.swift

@@ -10,7 +10,7 @@ import Foundation
 import UIKit
 
 extension UIColor {
-    public  class func hexColor(hexadecimal: String) -> UIColor {
+    public  class func hexColor(hexadecimal: String,alpha:CGFloat = 1) -> UIColor {
         var cstr = hexadecimal.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).uppercased() as NSString
         if cstr.length < 6 {
             return UIColor.clear
@@ -41,6 +41,6 @@ extension UIColor {
         Scanner(string: rStr).scanHexInt32(&r)
         Scanner(string: gStr).scanHexInt32(&g)
         Scanner(string: bStr).scanHexInt32(&b)
-        return UIColor(red: CGFloat(r) / 255.0, green: CGFloat(g) / 255.0, blue: CGFloat(b) / 255.0, alpha: 1)
+        return UIColor(red: CGFloat(r) / 255.0, green: CGFloat(g) / 255.0, blue: CGFloat(b) / 255.0, alpha: alpha)
     }
 }