Merge branch 'upstream' into subtree
[fanfix.git] / src / jexer / bits / Color.java
diff --git a/src/jexer/bits/Color.java b/src/jexer/bits/Color.java
deleted file mode 100644 (file)
index dd3b93d..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Jexer - Java Text User Interface
- *
- * Version: $Id$
- *
- * Author: Kevin Lamonte, <a href="mailto:kevin.lamonte@gmail.com">kevin.lamonte@gmail.com</a>
- *
- * License: LGPLv3 or later
- *
- * Copyright: This module is licensed under the GNU Lesser General
- * Public License Version 3.  Please see the file "COPYING" in this
- * directory for more information about the GNU Lesser General Public
- * License Version 3.
- *
- *     Copyright (C) 2015  Kevin Lamonte
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 3 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, see
- * http://www.gnu.org/licenses/, or write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-package jexer.bits;
-
-/**
- * A text cell color.
- */
-public class Color {
-
-    /**
-     * The color value.  Default is WHITE.
-     */
-    public int value = 7;
-
-    /**
-     * Public constructor
-     */
-    public Color(int value) {
-       this.value = value;
-    }
-
-    // The color integer values.  NOT EXPOSED.
-    static private final int black   = 0;
-    static private final int red     = 1;
-    static private final int green   = 2;
-    static private final int yellow  = 3;
-    static private final int blue    = 4;
-    static private final int magenta = 5;
-    static private final int cyan    = 6;
-    static private final int white   = 7;
-
-    /**
-     * Black.  Bold + black = dark grey
-     */
-    static public final Color BLACK = new Color(black);
-
-    /**
-     * Red
-     */
-    static public final Color RED = new Color(red);
-
-    /**
-     * Green
-     */
-    static public final Color GREEN  = new Color(green);
-
-    /**
-     * Yellow.  Sometimes not-bold yellow is brown.
-     */
-    static public final Color YELLOW = new Color(yellow);
-
-    /**
-     * Blue
-     */
-    static public final Color BLUE = new Color(blue);
-
-    /**
-     * Magenta (purple)
-     */
-    static public final Color MAGENTA = new Color(magenta);
-
-    /**
-     * Cyan (blue-green)
-     */
-    static public final Color CYAN = new Color(cyan);
-
-    /**
-     * White
-     */
-    static public final Color WHITE = new Color(white);
-
-    /**
-     * Invert a color in the same way as (CGA/VGA color XOR 0x7).
-     * @return the inverted color
-     */
-    public Color invert() {
-       switch (value) {
-       case black:
-           return Color.WHITE;
-       case white:
-           return Color.BLACK;
-       case red:
-           return Color.CYAN;
-       case cyan:
-           return Color.RED;
-       case green:
-           return Color.MAGENTA;
-       case magenta:
-           return Color.GREEN;
-       case blue:
-           return Color.YELLOW;
-       case yellow:
-           return Color.BLUE;
-       }
-       throw new IllegalArgumentException("Invalid Color value: " +
-           value);
-    }
-
-    /**
-     * Comparison.  All fields must match to return true.
-     */
-    @Override
-    public boolean equals(Object rhs) {
-       if (!(rhs instanceof Color)) {
-           return false;
-       }
-
-       Color that = (Color)rhs;
-       return (value == that.value);
-    }
-}