ColorPreference.java 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. package holeg.preferences;
  2. import holeg.model.Flexibility.FlexState;
  3. import holeg.model.HolonObject.HolonObjectState;
  4. import java.awt.*;
  5. /**
  6. * A Class to save all colors in Holeg.
  7. *
  8. * @author Tom
  9. */
  10. public class ColorPreference {
  11. public static class Element {
  12. public static final Color Active = new Color(255, 203, 35);
  13. public static final Color Inactive = new Color(128, 154, 163);
  14. public static class Priority {
  15. public static final Color Essential = new Color(201, 44, 74);
  16. public static final Color High = new Color(255, 92, 26);
  17. public static final Color Medium = new Color(255, 216, 57);
  18. public static final Color Low = new Color(255, 255, 175);
  19. }
  20. }
  21. public static class HolonObject {
  22. public static final Color Producer = new Color(149, 152, 159, 211);
  23. public static final Color OverSupplied = new Color(166, 78, 229);
  24. public static final Color Supplied = new Color(13, 175, 28);
  25. public static final Color PartiallySupplied = new Color(255, 233, 1);
  26. public static final Color NotSupplied = new Color(230, 120, 100);
  27. public static final Color NoEnergy = new Color(211, 211, 211);
  28. public static Color getStateColor(HolonObjectState state) {
  29. return switch (state) {
  30. case NOT_SUPPLIED -> NotSupplied;
  31. case OVER_SUPPLIED -> OverSupplied;
  32. case PARTIALLY_SUPPLIED -> PartiallySupplied;
  33. case PRODUCER -> Producer;
  34. case SUPPLIED -> Supplied;
  35. case NO_ENERGY -> NoEnergy;
  36. };
  37. }
  38. }
  39. public static class Edge {
  40. public static final Color Working = new Color(13, 175, 28);
  41. public static final Color Burned = Color.red;
  42. }
  43. public static class Energy {
  44. public static final Color Production = new Color(61, 133, 243);
  45. public static final Color Consumption = new Color(255, 67, 60);
  46. }
  47. public static class Flexibility {
  48. public static final Color InUse = new Color(182, 238, 166);
  49. public static final Color OnCooldown = new Color(239, 215, 128);
  50. public static final Color Offered = new Color(75, 170, 72);
  51. public static final Color NotOffered = new Color(237, 106, 90);
  52. public static final Color Unavailable = new Color(193, 193, 193);
  53. public static final Color NoFlexibility = new Color(101, 101, 101);
  54. public static Color getStateColor(FlexState state) {
  55. return switch (state) {
  56. case IN_USE -> InUse;
  57. case NOT_OFFERED -> NotOffered;
  58. case OFFERED -> Offered;
  59. case ON_COOLDOWN -> OnCooldown;
  60. case UNAVAILABLE -> Unavailable;
  61. };
  62. }
  63. }
  64. public static class Panel {
  65. public static final Color Transparent = new Color(0, 0, 0, 0);
  66. public static final Color Background = new Color(250, 250, 250);
  67. public static final Color Title = new Color(54, 73, 78);
  68. }
  69. public static class Canvas {
  70. public static final Color MouseSelectionBorder = new Color(0, 120, 215);
  71. public static final Color MouseSelectionFill = new Color(128, 174, 247, 40);
  72. public static final Color ObjectSelectionBorder = new Color(153, 209, 255);
  73. public static final Color ObjectSelectionFill = new Color(205, 233, 255);
  74. }
  75. public static class InformationPanel{
  76. public static final Color NoData = new Color(243, 243, 243, 255);
  77. }
  78. public static class Dialog {
  79. public static final Color BackgroundColor = new Color(255, 50, 50);
  80. }
  81. public static class Category {
  82. public final static Color Focus = new Color(219, 245, 255);
  83. }
  84. public static class Inspector {
  85. public final static Color Selected = new Color(126, 186, 255);
  86. public final static Color Border = new Color(171, 173, 179);
  87. }
  88. public static class GUI {
  89. //TODO(Tom2021-12-1) for what is this collor used
  90. public static final Color PALE_RED = new Color(255, 192, 192);
  91. }
  92. }