-
Notifications
You must be signed in to change notification settings - Fork 96
/
NotifierColorsFactory.java
69 lines (61 loc) · 2.13 KB
/
NotifierColorsFactory.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
/*******************************************************************************
* Copyright (c) 2011 Laurent CARON
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Laurent CARON (laurent.caron at gmail dot com) - initial API and implementation
*******************************************************************************/
package org.eclipse.nebula.widgets.opal.notifier;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
/**
* This class creates the colors associated to a given theme
*
*/
public class NotifierColorsFactory {
public enum NotifierTheme {
YELLOW_THEME, GRAY_THEME, BLUE_THEME
};
/**
* Constructor
*/
private NotifierColorsFactory() {
}
/**
* @param theme a theme for the notifier widget
* @return the color set for the given theme
*/
static NotifierColors getColorsForTheme(final NotifierTheme theme) {
final NotifierColors colors = new NotifierColors();
Display display = Display.getDefault();
switch (theme) {
case BLUE_THEME:
colors.textColor = new Color(display, 4, 64, 140);
colors.titleColor = new Color(display, 0, 0, 0);
colors.borderColor = new Color(display, 153, 188, 232);
colors.leftColor = new Color(display, 210, 225, 244);
colors.rightColor = new Color(display, 182, 207, 238);
break;
case GRAY_THEME:
colors.textColor = new Color(display, 0, 0, 0);
colors.titleColor = new Color(display, 255, 20, 20);
colors.borderColor = new Color(display, 208, 208, 208);
colors.leftColor = new Color(display, 255, 255, 255);
colors.rightColor = new Color(display, 208, 208, 208);
break;
default:
colors.textColor = new Color(display, 0, 0, 0);
colors.titleColor = new Color(display, 0, 0, 0);
colors.borderColor = new Color(display, 218, 178, 85);
colors.leftColor = new Color(display, 220, 220, 160);
colors.rightColor = new Color(display, 255, 255, 191);
break;
}
return colors;
}
}