Color+Extensions.swift 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import SwiftUI
  2. import UIKit
  3. extension Color {
  4. static let carbs = Color("carbs")
  5. static let fresh = Color("fresh")
  6. static let glucose = Color("glucose")
  7. static let insulin =
  8. // workaround for 'No color named 'Insulin' found in asset catalog' error which is most likely a bug
  9. Color(
  10. UIColor(named: "Insulin") ??
  11. UIColor(red: 0.118, green: 0.588, blue: 0.988, alpha: 1.0) // these are RGB of our insulin color
  12. )
  13. // The loopAccent color is intended to be use as the app accent color.
  14. public static let loopAccent = Color("accent")
  15. public static let warning = Color("warning")
  16. }
  17. // Color version of the UIColor context colors
  18. public extension Color {
  19. static let agingColor = warning
  20. static let axisLabelColor = secondary
  21. static let axisLineColor = clear
  22. #if os(iOS)
  23. static let cellBackgroundColor = Color(UIColor.cellBackgroundColor)
  24. static let gridColor = Color(UIColor.gridColor)
  25. static let unknownColor = Color(UIColor.unknownColor)
  26. #endif
  27. static let carbTintColor = carbs
  28. static let critical = red
  29. static let destructive = critical
  30. static let glucoseTintColor = glucose
  31. static let invalid = critical
  32. static let insulinTintColor = insulin
  33. static let pumpStatusNormal = insulin
  34. static let staleColor = critical
  35. }
  36. extension Color {
  37. static let loopGray = Color("LoopGray")
  38. static let loopGreen = Color("LoopGreen")
  39. static let loopYellow = Color("LoopYellow")
  40. static let loopRed = Color("LoopRed")
  41. static let loopManualTemp = Color("ManualTempBasal")
  42. static let bgDarkBlue = Color("Background_DarkBlue")
  43. static let bgDarkerDarkBlue = Color("Background_DarkerDarkBlue")
  44. static let chart = Color("Chart")
  45. static let tabBar = Color("TabBar")
  46. // static let insulin = Color("Insulin")
  47. static let uam = Color("UAM")
  48. static let zt = Color("ZT")
  49. static let tempBasal = Color("TempBasal")
  50. static let basal = Color("Basal")
  51. static let darkerBlue = Color("DarkerBlue")
  52. static let loopPink = Color("LoopPink")
  53. static let lemon = Color("Lemon")
  54. static let minus = Color("minus")
  55. static let darkGray = Color("darkGray")
  56. }