MacroDefinition.swift 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // MacroDefinition.swift
  3. // HCQuanfangtong
  4. //
  5. // Created by Apple on 2022/5/28.
  6. // Copyright © 2022 Jyp. All rights reserved.
  7. //
  8. import Foundation
  9. import UIKit
  10. //MARK: - 屏幕相关
  11. let kSCREEN_WIDTH : CGFloat = UIScreen.main.bounds.size.width
  12. let kSCREEN_HEIGHT : CGFloat = UIScreen.main.bounds.size.height
  13. ///时间状态栏高度
  14. let kStatuBarHeight : CGFloat = UIApplication.shared.statusBarFrame.height
  15. ///导航栏高度44
  16. let KNavBarHeight : CGFloat = 44
  17. ///导航栏加时间状态栏高度
  18. let kNavAndStatuHeight : CGFloat = kStatuBarHeight + KNavBarHeight
  19. ///IphoneX以上机型
  20. var kIsIphoneX : Bool = {
  21. if #available(iOS 11.0,*) {
  22. if let dis = UIApplication.shared.delegate?.window??.safeAreaInsets.bottom {
  23. return dis > 0
  24. }
  25. else{
  26. return false
  27. }
  28. }
  29. return false
  30. }()
  31. ///底部tabbar高度
  32. let kTabBarHeight : CGFloat = (kIsIphoneX == false ?49 : 83)
  33. //MARK: - New Version Color
  34. /// 主题色 红
  35. var kThemeColor : UIColor = UIColor.color(hex: "#C62223")
  36. /// 主题色 透明红
  37. var kThemeColorAlpha : UIColor = UIColor.color(hex: "#C62223", alpha: 0.3)
  38. ///灰白背景
  39. var kTBackgroundColor : UIColor = UIColor.color(hex: "#EDEDED")
  40. /// 主题黑色
  41. var kThemeBlackColor : UIColor = UIColor.color(hex: "#212122")
  42. /// 主题白色
  43. var kThemeWhiteColor : UIColor = UIColor.color(hex: "#FFFFFF")
  44. /// 危险色 红色
  45. var kThemeDangerousColor: UIColor = UIColor.color(hex: "#F56C6C")
  46. /// 提示颜色 橙色
  47. var kThemeOfPromptColor : UIColor! = UIColor.color(hex: "#E6A23C")
  48. /// 成功色 绿色
  49. var kThemeOfSuccessColor: UIColor! = UIColor.color(hex: "#67C23A")
  50. /// 遮罩颜色 #000000 0.5
  51. var kThemeMaskColor : UIColor = UIColor.init(red: 0, green: 0, blue: 0, alpha: 0.5)
  52. /// 主题背景颜色
  53. var kThemeOfBackgroundColor : UIColor! = UIColor.color(hex: "#F7F7F7")
  54. /// 分割线颜色
  55. var kThemeOfLineColor : UIColor! = UIColor.color(hex: "#E7E8ED")
  56. /// 需要突出显示的块 背景颜色
  57. var kThemeOfInputBackgroundColor : UIColor! = UIColor.color(hex: "#F5F7FA")
  58. //MARK: text
  59. /// 主题文字颜色
  60. var kThemeOfTextBlackColor : UIColor! = UIColor.color(hex: "#232C37")
  61. /// 主题文字颜色 深灰
  62. var kThemeOfTextDarkColor : UIColor! = UIColor.color(hex: "#6F7884")
  63. /// 主题文字颜色 浅灰
  64. var kThemeOfTextLightColor : UIColor! = UIColor.color(hex: "#89939F")
  65. /// 主题文字置灰字体
  66. var kThemeOfTextDisabledColor : UIColor! = UIColor.color(hex: "#89939F")
  67. /// 主题input placeholderColor
  68. var kThemeOfTextPlaceholderColor : UIColor! = UIColor.color(hex: "#BDC3CE")
  69. //MARK: button
  70. // 实心按钮高亮背景颜色
  71. var kThemeOfButtonTapBackgroundColor : UIColor! = UIColor.color(hex: "#3C51A8")
  72. // 实心按钮不可点击背景颜色
  73. var kThemeOfButtonDisabledBackgroundColor : UIColor! = kThemeOfLineColor
  74. // 空心按钮 高亮状态背景色 4169E1 0.05 可被作为空心按钮的选中颜色
  75. var kThemeOfButtonEmptyTapBackgroundColor : UIColor = UIColor.init(red: 65.0/255.0, green: 105.0/255.0, blue: 225.0/255.0, alpha: 0.05)