@@ -25,21 +25,15 @@ public class Snippet384 {
25
25
26
26
private static Display display = new Display ();
27
27
28
- private static final boolean ENABLE_DARK_MODE = false ;
29
-
30
28
private static final Color LIGHT_THEME_BACKGROUND = display .getSystemColor (SWT .COLOR_WIDGET_BACKGROUND );
31
29
private static final Color DARK_THEME_GRAY = new Color (47 , 47 , 47 );
32
30
private static final Color DARK_THEME_GRAY_DARKER = new Color (72 , 72 , 76 );
33
31
34
32
// colors and thresholds used in the current Win32/macOS algorithm
35
33
private static final RGB GRAY_LOW = display .getSystemColor (SWT .COLOR_WIDGET_NORMAL_SHADOW ).getRGB (); // == RGB(160, 160, 160) on Windows
36
-
37
34
private static final RGB GRAY_HIGH = display .getSystemColor (SWT .COLOR_WIDGET_BACKGROUND ).getRGB (); // == RGB(240, 240,240) on Windows
38
-
39
35
private static final int WIN32_COCOA_THRESHOLD = 98304 ; // == 3 * 2^15, this is the real threshold used in Win32/macOS
40
-
41
36
private static final int BACKGROUND_THRESHOLD = GRAY_HIGH .red * GRAY_HIGH .red + GRAY_HIGH .green + GRAY_HIGH .green + GRAY_HIGH .blue * GRAY_HIGH .blue ; // == on windows 240^2 * 3
42
-
43
37
private static final int MAX_BRIGHTNESS = 256 * 256 * 3 ;
44
38
45
39
// change these to adjust the sliders default values
@@ -125,7 +119,6 @@ public static void main(String[] args) {
125
119
addImageUpdateScaleListener (highScale , adjThreshAdditGray , adjThreshAdditGray ::setThresholdHigh , imageRowStorage , originalImages );
126
120
addImageUpdateScaleListener (thirdGray , adjThreshAdditGray , value -> adjThreshAdditGray .setGrayMid (new RGB (value , value , value )), imageRowStorage , originalImages );
127
121
128
-
129
122
// combo box for theme selection
130
123
Combo themeCombo = new Combo (shell , SWT .DROP_DOWN | SWT .READ_ONLY );
131
124
themeCombo .setItems ("Light Theme" , "Dark Theme" , "Darker Theme" );
@@ -147,7 +140,6 @@ public static void main(String[] args) {
147
140
}
148
141
});
149
142
150
-
151
143
shell .open ();
152
144
shell .layout ();
153
145
@@ -158,9 +150,7 @@ public static void main(String[] args) {
158
150
}
159
151
160
152
originalImages .forEach (Image ::dispose );
161
-
162
153
display .dispose ();
163
-
164
154
}
165
155
166
156
private static void addTransformationRow (Composite parent , String labelText , PixelTransformer transformer ,
0 commit comments