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.

112 lines
2.7 KiB

6 years 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: "#ed1b24")
  23. }
  24. // 2D368F // origin: 303e9f // princess blue: 00539C // nebulas blue: 3F69AA // galaxy blue: #2A4B7C
  25. // UIColor(red:0.00, green:0.47, blue:0.76, alpha:1.0)
  26. // #3d6098
  27. class var themeBlue: UIColor {
  28. return .init(hex: "#303e9f")
  29. }
  30. class var themeGreen: UIColor {
  31. return .init(hex: "#08A384")
  32. }
  33. class var themeGray3: UIColor {
  34. return UIColor(red:0.67, green:0.67, blue:0.67, alpha:1.0)
  35. }
  36. class var themeGray2: UIColor {
  37. return UIColor(red:0.83, green:0.83, blue:0.83, alpha:1.0)
  38. }
  39. class var themeGray1: UIColor {
  40. return UIColor(red:0.93, green:0.93, blue:0.93, alpha:1.0)
  41. }
  42. // #e7e7e7 // ffffff
  43. class var themeWhite: UIColor {
  44. return UIColor(named: "ThemeWhite") ?? .white
  45. }
  46. class var themeBlack: UIColor {
  47. return UIColor(named: "ThemeBlack") ?? .black
  48. }
  49. class var themeMainBackground: UIColor {
  50. return UIColor(named: "ThemeMainBackground") ?? .white
  51. }
  52. class var themeRedDark: UIColor {
  53. return UIColor(named: "ThemeRedDark") ?? .white
  54. }
  55. class var themeWhiteRed: UIColor {
  56. return UIColor(named: "ThemeWhiteRed") ?? .white
  57. }
  58. class var themeRedWhite: UIColor {
  59. return UIColor(named: "ThemeRedWhite") ?? .white
  60. }
  61. class var themeSubBackground: UIColor {
  62. return UIColor(named: "ThemeSubBackground") ?? .lightGray
  63. }
  64. class var themeText: UIColor {
  65. return UIColor(named: "ThemeText") ?? .init(hex: "4A4A4A")
  66. }
  67. class var themeSeparate: UIColor {
  68. return UIColor(named: "ThemeSeparate") ?? .init(hex: "4A4A4A")
  69. }
  70. class var themeDarkRed: UIColor {
  71. return .init(hex: "#be0007")
  72. }
  73. class var themeBorderColor: UIColor {
  74. return .init(red:0.91, green:0.93, blue:0.95, alpha:1.0)
  75. }
  76. class var themeTextColor: UIColor {
  77. return .init(hex: "4A4A4A")
  78. }
  79. class var themeTitleTextColor: UIColor {
  80. return .init(hex: "6E6E6E")
  81. }
  82. class var themeBackgroundColor: UIColor {
  83. return .init(hex: "E7EDF2")
  84. }
  85. class var themeBackgroundGray: UIColor {
  86. return UIColor.black.withAlphaComponent(0.5)
  87. }
  88. }