-
-
Notifications
You must be signed in to change notification settings - Fork 454
/
ChartColor.java
189 lines (158 loc) · 6.63 KB
/
ChartColor.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/* ===========================================================
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
* (C) Copyright 2000-2020, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
* This library 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 2.1 of the License, or
* (at your option) any later version.
*
* This library 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
* [Oracle and Java are registered trademarks of Oracle and/or its affiliates.
* Other names may be trademarks of their respective owners.]
*
* ---------------
* ChartColor.java
* ---------------
* (C) Copyright 2003-2016, by Cameron Riley and Contributors.
*
* Original Author: Cameron Riley;
* Contributor(s): David Gilbert (for Object Refinery Limited);
*
* Changes
* -------
* 23-Jan-2003 : Version 1, contributed by Cameron Riley (DG);
* 25-Nov-2004 : Changed first 7 colors to softer shades (DG);
* 03-Nov-2005 : Removed orange color, too close to yellow - see bug
* report 1328408 (DG);
* ------------- JFREECHART 1.0.x ---------------------------------------------
* 02-Feb-2007 : Removed author tags all over JFreeChart sources (DG);
*
*/
package org.jfree.chart;
import java.awt.Color;
import java.awt.Paint;
/**
* Class to extend the number of Colors available to the charts. This
* extends the java.awt.Color object and extends the number of final
* Colors publically accessible.
*/
public class ChartColor extends Color {
/** A very dark red color. */
public static final Color VERY_DARK_RED = new Color(0x80, 0x00, 0x00);
/** A dark red color. */
public static final Color DARK_RED = new Color(0xc0, 0x00, 0x00);
/** A light red color. */
public static final Color LIGHT_RED = new Color(0xFF, 0x40, 0x40);
/** A very light red color. */
public static final Color VERY_LIGHT_RED = new Color(0xFF, 0x80, 0x80);
/** A very dark yellow color. */
public static final Color VERY_DARK_YELLOW = new Color(0x80, 0x80, 0x00);
/** A dark yellow color. */
public static final Color DARK_YELLOW = new Color(0xC0, 0xC0, 0x00);
/** A light yellow color. */
public static final Color LIGHT_YELLOW = new Color(0xFF, 0xFF, 0x40);
/** A very light yellow color. */
public static final Color VERY_LIGHT_YELLOW = new Color(0xFF, 0xFF, 0x80);
/** A very dark green color. */
public static final Color VERY_DARK_GREEN = new Color(0x00, 0x80, 0x00);
/** A dark green color. */
public static final Color DARK_GREEN = new Color(0x00, 0xC0, 0x00);
/** A light green color. */
public static final Color LIGHT_GREEN = new Color(0x40, 0xFF, 0x40);
/** A very light green color. */
public static final Color VERY_LIGHT_GREEN = new Color(0x80, 0xFF, 0x80);
/** A very dark cyan color. */
public static final Color VERY_DARK_CYAN = new Color(0x00, 0x80, 0x80);
/** A dark cyan color. */
public static final Color DARK_CYAN = new Color(0x00, 0xC0, 0xC0);
/** A light cyan color. */
public static final Color LIGHT_CYAN = new Color(0x40, 0xFF, 0xFF);
/** Aa very light cyan color. */
public static final Color VERY_LIGHT_CYAN = new Color(0x80, 0xFF, 0xFF);
/** A very dark blue color. */
public static final Color VERY_DARK_BLUE = new Color(0x00, 0x00, 0x80);
/** A dark blue color. */
public static final Color DARK_BLUE = new Color(0x00, 0x00, 0xC0);
/** A light blue color. */
public static final Color LIGHT_BLUE = new Color(0x40, 0x40, 0xFF);
/** A very light blue color. */
public static final Color VERY_LIGHT_BLUE = new Color(0x80, 0x80, 0xFF);
/** A very dark magenta/purple color. */
public static final Color VERY_DARK_MAGENTA = new Color(0x80, 0x00, 0x80);
/** A dark magenta color. */
public static final Color DARK_MAGENTA = new Color(0xC0, 0x00, 0xC0);
/** A light magenta color. */
public static final Color LIGHT_MAGENTA = new Color(0xFF, 0x40, 0xFF);
/** A very light magenta color. */
public static final Color VERY_LIGHT_MAGENTA = new Color(0xFF, 0x80, 0xFF);
/**
* Creates a Color with an opaque sRGB with red, green and blue values in
* range 0-255.
*
* @param r the red component in range 0x00-0xFF.
* @param g the green component in range 0x00-0xFF.
* @param b the blue component in range 0x00-0xFF.
*/
public ChartColor(int r, int g, int b) {
super(r, g, b);
}
/**
* Convenience method to return an array of {@code Paint} objects that
* represent the pre-defined colors in the {@code Color} and
* {@code ChartColor} objects.
*
* @return An array of objects with the {@code Paint} interface.
*/
public static Paint[] createDefaultPaintArray() {
return new Paint[] {
new Color(0xFF, 0x55, 0x55),
new Color(0x55, 0x55, 0xFF),
new Color(0x55, 0xFF, 0x55),
new Color(0xFF, 0xFF, 0x55),
new Color(0xFF, 0x55, 0xFF),
new Color(0x55, 0xFF, 0xFF),
Color.pink,
Color.gray,
ChartColor.DARK_RED,
ChartColor.DARK_BLUE,
ChartColor.DARK_GREEN,
ChartColor.DARK_YELLOW,
ChartColor.DARK_MAGENTA,
ChartColor.DARK_CYAN,
Color.darkGray,
ChartColor.LIGHT_RED,
ChartColor.LIGHT_BLUE,
ChartColor.LIGHT_GREEN,
ChartColor.LIGHT_YELLOW,
ChartColor.LIGHT_MAGENTA,
ChartColor.LIGHT_CYAN,
Color.lightGray,
ChartColor.VERY_DARK_RED,
ChartColor.VERY_DARK_BLUE,
ChartColor.VERY_DARK_GREEN,
ChartColor.VERY_DARK_YELLOW,
ChartColor.VERY_DARK_MAGENTA,
ChartColor.VERY_DARK_CYAN,
ChartColor.VERY_LIGHT_RED,
ChartColor.VERY_LIGHT_BLUE,
ChartColor.VERY_LIGHT_GREEN,
ChartColor.VERY_LIGHT_YELLOW,
ChartColor.VERY_LIGHT_MAGENTA,
ChartColor.VERY_LIGHT_CYAN
};
}
}