Commit faf2526e authored by David黄金龙's avatar David黄金龙

处理 颜色值

parent 078f98f7
...@@ -42,7 +42,7 @@ target 'galaxy' do ...@@ -42,7 +42,7 @@ target 'galaxy' do
#定时器 #定时器
pod 'SwiftyTimer','2.1.0' pod 'SwiftyTimer','2.1.0'
#UIColor 的扩展 #UIColor 的扩展
pod 'Hue','5.0.0' # pod 'Hue','5.0.0'
#内存泄漏 #内存泄漏
pod 'LifetimeTracker','1.8.1' pod 'LifetimeTracker','1.8.1'
#控制台转换成中文 #控制台转换成中文
......
...@@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
//2.通用UI设置 //2.通用UI设置
// setupWholeUI() setupWholeUI()
//3.其他第三方sdk设置 //3.其他第三方sdk设置
thirdSetting() thirdSetting()
...@@ -104,28 +104,9 @@ extension AppDelegate { ...@@ -104,28 +104,9 @@ extension AppDelegate {
//异步延迟设置 //异步延迟设置
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.25) { [] in DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.25) { [] in
//1、系统控件属性设置 //1、系统控件属性设置
//1.1 UITextField.appearance().tintColor = .brandMainColor
UITextField.appearance().tintColor = .mainColor UITextView.appearance().tintColor = .brandMainColor
UITextView.appearance().tintColor = .mainColor
//1.2设置UINavigationBar title的字体和颜色
let titleTextAttributes = [NSAttributedString.Key.font : UIFont.PFSC_M(ofSize: 16) , NSAttributedString.Key.foregroundColor : UIColor.commonColor100]
UINavigationBar.appearance().titleTextAttributes = titleTextAttributes
UINavigationBar.appearance().tintColor = .white
//1.3UITabBar bar 的选中颜色
UITabBar.appearance().tintColor = UIColor.commonColor100
//1.4tabbar默认的背景色
UITabBar.appearance().barTintColor = UIColor.white
//2、一键登录初始化
// TXCommonHandler.sharedInstance().setAuthSDKInfo(BsConstant.kAliOnePressPhoneLoginKey)
//3.微信登录初始化
// BsWxLoginManager.shared.doWxInit()
//4.
IQKeyboardManager.shared.enable = true IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = true IQKeyboardManager.shared.enableAutoToolbar = true
IQKeyboardManager.shared.resignOnTouchOutside = true // 控制点击背景是否收起键盘 IQKeyboardManager.shared.resignOnTouchOutside = true // 控制点击背景是否收起键盘
......
...@@ -14,9 +14,9 @@ class YHBasicContentView: ESTabBarItemContentView { ...@@ -14,9 +14,9 @@ class YHBasicContentView: ESTabBarItemContentView {
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
textColor = UIColor.init(white: 175.0 / 255.0, alpha: 1.0) textColor = UIColor.init(white: 175.0 / 255.0, alpha: 1.0)
highlightTextColor = .commonColor100 highlightTextColor = .brandMainColor
iconColor = UIColor.init(white: 175.0 / 255.0, alpha: 1.0) iconColor = UIColor.init(white: 175.0 / 255.0, alpha: 1.0)
highlightIconColor = .commonColor100 highlightIconColor = .brandMainColor
titleLabel.font = UIFont.PFSC_R(ofSize: 10) titleLabel.font = UIFont.PFSC_R(ofSize: 10)
} }
......
...@@ -20,21 +20,21 @@ class YHNoDataTipView: UIView { ...@@ -20,21 +20,21 @@ class YHNoDataTipView: UIView {
}() }()
private lazy var titleLabel: UILabel = { private lazy var titleLabel: UILabel = {
let label = UILabel(text: "暂无数据", font: UIFont.PFSC_R(ofSize: 14), color: UIColor.commonColor45) let label = UILabel(text: "暂无数据", font: UIFont.PFSC_R(ofSize: 14), color: UIColor.labelTextColor2)
return label return label
}() }()
private lazy var descLabel: UILabel = { private lazy var descLabel: UILabel = {
let label = UILabel(text: "", font: UIFont.PFSC_R(ofSize: 12), color: UIColor.commonColor45) let label = UILabel(text: "", font: UIFont.PFSC_R(ofSize: 12), color: UIColor.labelTextColor2)
return label return label
}() }()
private lazy var reloadBtn: UIButton = { private lazy var reloadBtn: UIButton = {
let btn = UIButton.bs_button(title: "重新加载", font: UIFont.PFSC_M(ofSize: 12), normalColor: UIColor.commonColor100) let btn = UIButton.bs_button(title: "重新加载", font: UIFont.PFSC_M(ofSize: 12), normalColor: UIColor.brandMainColor)
btn.layer.cornerRadius = 6 btn.layer.cornerRadius = 6
btn.layer.masksToBounds = true btn.layer.masksToBounds = true
btn.layer.borderWidth = 1 btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.commonColor10.cgColor btn.layer.borderColor = UIColor.labelTextColor2.cgColor
btn.addTarget(self, action: #selector(onReloadData), for: .touchUpInside) btn.addTarget(self, action: #selector(onReloadData), for: .touchUpInside)
return btn return btn
}() }()
......
...@@ -109,10 +109,10 @@ class YHHomeViewController: YHBaseViewController { ...@@ -109,10 +109,10 @@ class YHHomeViewController: YHBaseViewController {
dataSource.titles = arrItemTitles dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 16) dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleNormalColor = .commonColor25 dataSource.titleNormalColor = UIColor(hexString: "#888F98")
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 18) dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 18)
dataSource.titleSelectedColor = .commonColor100 dataSource.titleSelectedColor = .brandMainColor
dataSource.isItemSpacingAverageEnabled = false dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension dataSource.itemWidth = JXSegmentedViewAutomaticDimension
......
...@@ -30,10 +30,10 @@ class YHMainContentBaseViewController: UIViewController { ...@@ -30,10 +30,10 @@ class YHMainContentBaseViewController: UIViewController {
dataSource.titles = arrItemTitles dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 16) dataSource.titleNormalFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleNormalColor = .commonColor25 dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 18) dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 18)
dataSource.titleSelectedColor = .commonColor100 dataSource.titleSelectedColor = .brandMainColor
dataSource.isItemSpacingAverageEnabled = false dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension dataSource.itemWidth = JXSegmentedViewAutomaticDimension
......
...@@ -127,7 +127,7 @@ extension YHDavidCell4: FSPagerViewDataSource, FSPagerViewDelegate { ...@@ -127,7 +127,7 @@ extension YHDavidCell4: FSPagerViewDataSource, FSPagerViewDelegate {
// cell.textLabel?.text = model.title // cell.textLabel?.text = model.title
} }
cell.imageView?.contentMode = .scaleAspectFill cell.imageView?.contentMode = .scaleAspectFill
cell.backgroundColor = .commonColor3 cell.backgroundColor = .contentBkgColor
cell.contentView.layer.shadowColor = UIColor.clear.cgColor cell.contentView.layer.shadowColor = UIColor.clear.cgColor
return cell return cell
......
...@@ -128,7 +128,7 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate { ...@@ -128,7 +128,7 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
} }
cell.imageView?.contentMode = .scaleAspectFill cell.imageView?.contentMode = .scaleAspectFill
cell.backgroundColor = .commonColor3 cell.backgroundColor = .contentBkgColor
cell.contentView.layer.shadowColor = UIColor.clear.cgColor cell.contentView.layer.shadowColor = UIColor.clear.cgColor
return cell return cell
......
...@@ -55,7 +55,7 @@ class YHFormItemEnterDetailCell: UITableViewCell { ...@@ -55,7 +55,7 @@ class YHFormItemEnterDetailCell: UITableViewCell {
lazy var detailLabel: UILabel = { lazy var detailLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.text = "XXXXXXX" label.text = "XXXXXXX"
label.textColor = UIColor(hexString: "#888F98") label.textColor = .labelTextColor2
label.textAlignment = .right label.textAlignment = .right
label.numberOfLines = 0 label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14) label.font = UIFont.PFSC_R(ofSize: 14)
......
...@@ -28,7 +28,7 @@ class YHFormItemTitleCell: UITableViewCell { ...@@ -28,7 +28,7 @@ class YHFormItemTitleCell: UITableViewCell {
lazy var subTitleLabel: UILabel = { lazy var subTitleLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.textColor = UIColor(hexString:"#888F98") label.textColor = .labelTextColor2
label.textAlignment = .left label.textAlignment = .left
label.numberOfLines = 0 label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14) label.font = UIFont.PFSC_R(ofSize: 14)
......
...@@ -60,7 +60,7 @@ class YHAboutUsViewController: YHBaseViewController { ...@@ -60,7 +60,7 @@ class YHAboutUsViewController: YHBaseViewController {
var label = UILabel() var label = UILabel()
label.text = "银河集团专注海外服务17年,总部设立在深圳,现已分别在北京、上海、广州等地建立分公司,立足于香港身份规划服务,业务逐步多元化发展。" label.text = "银河集团专注海外服务17年,总部设立在深圳,现已分别在北京、上海、广州等地建立分公司,立足于香港身份规划服务,业务逐步多元化发展。"
label.numberOfLines = 0 label.numberOfLines = 0
label.textColor = UIColor(hexString:"#888F98") label.textColor = .labelTextColor2
label.textAlignment = NSTextAlignment.left label.textAlignment = NSTextAlignment.left
label.font = UIFont.systemFont(ofSize: 14) label.font = UIFont.systemFont(ofSize: 14)
return label return label
......
...@@ -40,7 +40,7 @@ class YHAboutUsAdvantageCell: UICollectionViewCell { ...@@ -40,7 +40,7 @@ class YHAboutUsAdvantageCell: UICollectionViewCell {
lazy var detailLabel:UILabel = { lazy var detailLabel:UILabel = {
let label = UILabel() let label = UILabel()
label.text = "sdfasfdasfasdfasfasdfasdfsafasdfasdfasdfasfdas" label.text = "sdfasfdasfasdfasfasdfasdfsafasdfasdfasdfasfdas"
label.textColor = UIColor(hexString:"#888F98") label.textColor = .labelTextColor2
label.numberOfLines = 0 label.numberOfLines = 0
label.textAlignment = .center label.textAlignment = .center
label.font = UIFont.systemFont(ofSize: 12) label.font = UIFont.systemFont(ofSize: 12)
......
...@@ -7,41 +7,6 @@ ...@@ -7,41 +7,6 @@
// //
import UIKit import UIKit
// MARK: - 设置导航栏样式
extension AppDelegate{
func customAppearance() {
setNavigationBarAppearanceWhenContainedInInstancesOf(containers: [YHNavigationController.self])
setNavigationBarAppearanceWhenContainedInInstancesOf(containers: [YHBaseViewController.self])
}
func setNavigationBarAppearanceWhenContainedInInstancesOf(containers: [UIAppearanceContainer.Type]){
let navigationBarAppearance = UINavigationBar.appearance(whenContainedInInstancesOf: containers)
navigationBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.commonColor100,NSAttributedString.Key.font:UIFont.PFSC_M(ofSize: 16)]
navigationBarAppearance.barTintColor = UIColor.yellow
navigationBarAppearance.tintColor = UIColor.commonColor100
navigationBarAppearance.backIndicatorImage = UIImage(named: "back_icon")
navigationBarAppearance.backIndicatorTransitionMaskImage = UIImage(named: "back_icon")
navigationBarAppearance.setBackgroundImage(UIImage.from(color: UIColor.clear),for: .default)
navigationBarAppearance.isOpaque = true
navigationBarAppearance.shadowImage = nil
//隐藏返回文字
if #available(iOS 13, *) {
UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffset( horizontal: -UIDevice.kScreenW, vertical: 0), for: .default)
}
let barItemAppearance = UIBarButtonItem.appearance(whenContainedInInstancesOf: containers)
barItemAppearance.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.clear,NSAttributedString.Key.font:UIFont.systemFont(ofSize: 14)], for: UIControl.State.normal)
barItemAppearance.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.clear,NSAttributedString.Key.font:UIFont.systemFont(ofSize: 14)], for: UIControl.State.highlighted)
}
}
// MARK: - Pay 支付 // MARK: - Pay 支付
extension AppDelegate { extension AppDelegate {
......
...@@ -10,27 +10,56 @@ import UIKit ...@@ -10,27 +10,56 @@ import UIKit
import SwifterSwift import SwifterSwift
extension UIColor { extension UIColor {
// MARK: - 当前 app 主颜色
static let mainColor : UIColor = UIColor(hexString: "#46E0BB")! //品牌主色
static let commonColor100 : UIColor = UIColor(hexString: "#333333",transparency: 1.0)! static let brandMainColor : UIColor = UIColor(hexString: "#2F7EF6")!
static let commonColor90 : UIColor = UIColor(hexString: "#333333",transparency: 0.9)!
static let commonColor65 : UIColor = UIColor(hexString: "#333333",transparency: 0.65)! //品牌渐变色
static let commonColor45 : UIColor = UIColor(hexString: "#333333",transparency: 0.45)! static let arrBrandGradaterColors : [UIColor] = [UIColor(hexString: "#2274EE")!,UIColor(hexString: "#3A85FC")!]
static let commonColor25 : UIColor = UIColor(hexString: "#333333",transparency: 0.25)!
static let commonColor15 : UIColor = UIColor(hexString: "#333333",transparency: 0.15)! //品牌主色 16
static let commonColor10 : UIColor = UIColor(hexString: "#333333",transparency: 0.10)! static let brandMainColor16 : UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)!
static let commonColor6 : UIColor = UIColor(hexString: "#333333",transparency: 0.06)!
static let commonColor4 : UIColor = UIColor(hexString: "#333333",transparency: 0.04)! //品牌主色 8
static let commonColor3 : UIColor = UIColor(hexString: "#333333",transparency: 0.03)! static let brandMainColor8: UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)!
static let backgroundColor : UIColor = UIColor(hexString: "#F2F7F6",transparency: 1.0)! //标题/主内容
static let mainTextColor : UIColor = UIColor(hexString: "#222222")!
static let mainTextColor : UIColor = UIColor(hexString: "#00D19F")! //次内容一
static let selectBgColor : UIColor = UIColor(hexString: "#D9FCF7")! static let subTextColor : UIColor = UIColor(hexString: "#4E4E4E")!
//黑色 50透明 //次内容二
static let black50Persent : UIColor = UIColor.black.withAlphaComponent(0.5) static let subTextColor2 : UIColor = UIColor(hexString: "#7A7A7A")!
//标注内容一
static let labelTextColor : UIColor = UIColor(hexString: "#D3D3D3")!
//标注内容二
static let labelTextColor2 : UIColor = UIColor(hexString: "#888F98")!
//成功 color
static let successColor : UIColor = UIColor(hexString: "#49D2B1")!
//失败 color
static let failColor : UIColor = UIColor(hexString: "#F81D22")!
//警告 color
static let warnColor : UIColor = UIColor(hexString: "#FF9900")!
//提示 color
static let tipsColor : UIColor = UIColor(hexString: "#2F7EF6")!
//页面背景
static let pageBkgColor : UIColor = UIColor(hexString: "#F8F8F8")!
//内容背景色
static let contentBkgColor : UIColor = UIColor(hexString: "#F8F9FB")!
public convenience init(r : CGFloat, g : CGFloat, b : CGFloat,alpha:CGFloat = 1.0) { public convenience init(r : CGFloat, g : CGFloat, b : CGFloat,alpha:CGFloat = 1.0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment