2 * Jexer - Java Text User Interface
6 * Author: Kevin Lamonte, <a href="mailto:kevin.lamonte@gmail.com">kevin.lamonte@gmail.com</a>
8 * License: LGPLv3 or later
10 * Copyright: This module is licensed under the GNU Lesser General
11 * Public License Version 3. Please see the file "COPYING" in this
12 * directory for more information about the GNU Lesser General Public
15 * Copyright (C) 2015 Kevin Lamonte
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public License
19 * as published by the Free Software Foundation; either version 3 of
20 * the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful, but
23 * WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * General Public License for more details.
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with this program; if not, see
29 * http://www.gnu.org/licenses/, or write to the Free Software
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
41 * The color value. Default is WHITE.
48 public Color(int value
) {
52 // The color integer values. NOT EXPOSED.
53 static private final int black
= 0;
54 static private final int red
= 1;
55 static private final int green
= 2;
56 static private final int yellow
= 3;
57 static private final int blue
= 4;
58 static private final int magenta
= 5;
59 static private final int cyan
= 6;
60 static private final int white
= 7;
63 * Black. Bold + black = dark grey
65 static public final Color BLACK
= new Color(black
);
70 static public final Color RED
= new Color(red
);
75 static public final Color GREEN
= new Color(green
);
78 * Yellow. Sometimes not-bold yellow is brown.
80 static public final Color YELLOW
= new Color(yellow
);
85 static public final Color BLUE
= new Color(blue
);
90 static public final Color MAGENTA
= new Color(magenta
);
95 static public final Color CYAN
= new Color(cyan
);
100 static public final Color WHITE
= new Color(white
);
103 * Invert a color in the same way as (CGA/VGA color XOR 0x7).
105 * @param color color to change
106 * @return the inverted color
108 static public Color
invert(Color color
) {
109 switch (color
.value
) {
119 return Color
.MAGENTA
;
127 throw new IllegalArgumentException("Invalid Color value: " +