You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
3.9 KiB

6 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
6 years ago
  1. //
  2. // UIColorExtension.swift
  3. // GMERemittance
  4. //
  5. // Created by Fm-user on 2/2/18.
  6. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. extension UIColor {
  10. convenience init(hex: Int) {
  11. let components = (
  12. R: CGFloat((hex >> 16) & 0xff) / 255,
  13. G: CGFloat((hex >> 08) & 0xff) / 255,
  14. B: CGFloat((hex >> 00) & 0xff) / 255
  15. )
  16. self.init(red: components.R, green: components.G, blue: components.B, alpha: 1)
  17. }
  18. // origin: ed1b24 // vivid red: ff2727 // cherry tomato: E94B3C // coral red: ff4040
  19. // UIColor(red:0.92, green:0.12, blue:0.18, alpha:1.0) // fiesta #dd1923
  20. // #f04b4c
  21. class var themeRed: UIColor {
  22. return .init(hex: "#DC1431")
  23. }
  24. class var themeIdStatusGreen: UIColor {
  25. return .init(hex: "#06c11f")
  26. }
  27. class var themeIdStatusRed: UIColor {
  28. return .init(hex: "#A41313")
  29. }
  30. class var themeRedDarkGradient: UIColor {
  31. return .init(hex: "#430c27")
  32. }
  33. // 2D368F // origin: 303e9f // princess blue: 00539C // nebulas blue: 3F69AA // galaxy blue: #2A4B7C
  34. // UIColor(red:0.00, green:0.47, blue:0.76, alpha:1.0)
  35. // #3d6098
  36. class var themeBlue: UIColor {
  37. return UIColor(named: "ThemeBlue") ?? .init(hex: "#0C2169")
  38. }
  39. class var theme2E89FF: UIColor {
  40. return UIColor.init(hex: "#2E89FF")
  41. }
  42. class var themeGreen: UIColor {
  43. return .init(hex: "#08A384")
  44. }
  45. class var darkBlue: UIColor {
  46. return .init(hex: "#2E89FF")
  47. }
  48. class var darkBlueColor: UIColor {
  49. return .init(hex: "#0052FF")
  50. }
  51. class var lightBlueColor: UIColor {
  52. return .init(hex: "#0052FF").withAlphaComponent(0.1)
  53. }
  54. class var themeGray3: UIColor {
  55. return UIColor(red:0.67, green:0.67, blue:0.67, alpha:1.0)
  56. }
  57. class var themeShadow: UIColor {
  58. return UIColor(hex: "#D6D6D6")
  59. }
  60. class var themeGray2: UIColor {
  61. return UIColor(red:0.83, green:0.83, blue:0.83, alpha:1.0)
  62. }
  63. class var themeGray1: UIColor {
  64. return UIColor(red:0.93, green:0.93, blue:0.93, alpha:1.0)
  65. }
  66. // #e7e7e7 // ffffff
  67. class var themeWhite: UIColor {
  68. return UIColor(named: "ThemeWhite") ?? .white
  69. }
  70. class var themeBlack: UIColor {
  71. return UIColor(named: "ThemeBlack") ?? .black
  72. }
  73. class var themeMainBackground: UIColor {
  74. return UIColor(named: "ThemeMainBackground") ?? .white
  75. }
  76. class var themeRedDark: UIColor {
  77. return UIColor(named: "ThemeRedDark") ?? .white
  78. }
  79. class var themeWhiteRed: UIColor {
  80. return UIColor(named: "ThemeWhiteRed") ?? .white
  81. }
  82. class var themeMixedRed: UIColor {
  83. return UIColor(named: "ThemeMixedRed") ?? .init(hex: "#8C96A0")
  84. }
  85. class var themeRedWhite: UIColor {
  86. return UIColor(named: "ThemeRedWhite") ?? .white
  87. }
  88. class var themeSubBackground: UIColor {
  89. return UIColor(named: "ThemeSubBackground") ?? .lightGray
  90. }
  91. class var themeText: UIColor {
  92. return UIColor(named: "ThemeText") ?? .init(hex: "#8C96A0")
  93. }
  94. class var themeSeparate: UIColor {
  95. return UIColor(named: "ThemeSeparate") ?? .init(hex: "#8C96A0")
  96. }
  97. class var themeDarkRed: UIColor {
  98. return .init(hex: "#be0007")
  99. }
  100. class var themeBorderColor: UIColor {
  101. return .init(red:0.91, green:0.93, blue:0.95, alpha:1.0)
  102. }
  103. class var themeTextColor: UIColor {
  104. return .init(hex: "#8C96A0")
  105. }
  106. class var themeTitleTextColor: UIColor {
  107. return .init(hex: "6E6E6E")
  108. }
  109. class var themeBackgroundColor: UIColor {
  110. return .init(hex: "E7EDF2")
  111. }
  112. class var themeBackgroundGray: UIColor {
  113. return UIColor.black.withAlphaComponent(0.5)
  114. }
  115. }