-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScheduleColor.java
More file actions
43 lines (33 loc) · 1.19 KB
/
ScheduleColor.java
File metadata and controls
43 lines (33 loc) · 1.19 KB
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
/***************************************************\
| |
| Copyright ©2005, 2006 |
| Michael Cook |
| |
\***************************************************/
import java.awt.Color;
public class ScheduleColor {
// red, green, blue, orange, pink, purple
private static Color[] fillColors = {new Color(255, 173, 175), new Color(119, 245, 125),
new Color(146, 186, 247), new Color(251, 213, 180),
new Color(244, 166, 234), new Color(203, 185, 239)};
private static Color[] borderColors = {new Color(253, 0, 15), new Color(0, 165, 0),
new Color(0, 78, 218), new Color(225, 118, 0),
new Color(196, 18, 178), new Color(82, 35, 165)};
public ScheduleColor() {
// Nothing to do
}
private int fixNumber(int number) {
int colorNumber = number;
while (colorNumber < 0)
colorNumber = colorNumber + fillColors.length;
while (colorNumber >= fillColors.length)
colorNumber = colorNumber - fillColors.length;
return colorNumber;
}
public Color getBorder(int colorNumber) {
return borderColors[fixNumber(colorNumber)];
}
public Color getFill(int colorNumber) {
return fillColors[fixNumber(colorNumber)];
}
}