keyboard accelerators
[fanfix.git] / src / jexer / bits / Color.java
index 707b244b12664aa04a2c691cb73cfa3973d06e27..54ae66aeaf0d54fac263e1e3445bfa47dc50ef9c 100644 (file)
@@ -215,6 +215,16 @@ public final class Color {
         return (value == that.value);
     }
 
+    /**
+     * Hashcode uses all fields in equals().
+     *
+     * @return the hash
+     */
+    @Override
+    public int hashCode() {
+        return value;
+    }
+
     /**
      * Make human-readable description of this Color.
      *
@@ -239,8 +249,9 @@ public final class Color {
             return "blue";
         case SGRYELLOW:
             return "yellow";
+        default:
+            throw new IllegalArgumentException("Invalid Color value: " + value);
         }
-        throw new IllegalArgumentException("Invalid Color value: " + value);
     }
 
 }