Skip to content

Commit cba958f

Browse files
committed
Swap Black for OpenBCI Dark Blue - Second pass
1 parent 8cb31d0 commit cba958f

11 files changed

Lines changed: 36 additions & 48 deletions

OpenBCI_GUI/ADS1299SettingsController.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ class ADS1299SettingsController {
104104
pushStyle();
105105
//stroke(31,69,110, 50);
106106
stroke(OBJECT_BORDER_GREY);
107-
fill(0, 0, 0, 100);
107+
fill(GREY_100);
108108
rect(x, y - columnLabelH, w, columnLabelH);
109109
popStyle();
110110

111111
//background
112112
pushStyle();
113113
noStroke();
114-
fill(0, 0, 0, 100);
114+
fill(GREY_100);
115115
rect(x, y, w + 1, h);
116116
popStyle();
117117

@@ -142,7 +142,7 @@ class ADS1299SettingsController {
142142

143143
//Draw background behind command buttons
144144
pushStyle();
145-
fill(0, 0, 0, 100);
145+
fill(GREY_100);
146146
rect(x, y + h, w + 1, commandBarH);
147147
if (showCustomCommandUI) {
148148
rect(customCmdUI_x, y + h + commandBarH, customCmdUI_w, commandBarH); //keep above style for other command buttons

OpenBCI_GUI/Grid.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Grid {
4141
public void draw() {
4242
pushStyle();
4343
textAlign(LEFT);
44-
stroke(0);
44+
stroke(OPENBCI_DARKBLUE);
4545
textFont(p5, 12);
4646

4747
if (drawTableInnerLines) {
@@ -69,7 +69,7 @@ class Grid {
6969

7070
if (drawTableBorder) {
7171
noFill();
72-
stroke(0);
72+
stroke(OPENBCI_DARKBLUE);
7373
rect(x, y, w, rowOffset[numRows - 1]);
7474
}
7575

OpenBCI_GUI/OpenBCI_GUI.pde

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,19 @@ PFont p6; //small Open Sans
226226
boolean setupComplete = false;
227227

228228
//Starting to collect the GUI-wide color pallet here. Rename constants all caps later...
229+
final color WHITE = color(255);
230+
final color BLACK = color(0);
229231
final color OPENBCI_DARKBLUE = color(1, 18, 41);
230232
final color OPENBCI_BLUE = color(31, 69, 110);
231233
final color boxColor = color(200);
232234
final color boxStrokeColor = OPENBCI_DARKBLUE;
233235
final color isSelected_color = color(184, 220, 105);
234-
final color colorNotPressed = color(255);
236+
final color colorNotPressed = WHITE;
235237
final color buttonsLightBlue = color(57,128,204);
238+
final color GREY_125 = color(125);
239+
final color GREY_100 = color(100);
240+
final color GREY_20 = color(20);
236241
final color TURN_ON_GREEN = color(184,220,105);
237-
final color WHITE = color(255);
238-
final color BLACK = color(0);
239242
final color TURN_OFF_RED = color(224, 56, 45);
240243
final color BUTTON_HOVER = color(177, 184, 193);//color(252, 221, 198);
241244
final color BUTTON_HOVER_LIGHT = color(211, 222, 232);

OpenBCI_GUI/W_DigitalRead.pde

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class W_DigitalRead extends Widget {
1212
private int numDigitalReadDots;
1313
float xF, yF, wF, hF;
1414
int dot_padding;
15-
float dot_x, dot_y, dot_h, dot_w; //values for actual time series chart (rectangle encompassing all digitalReadDots)
15+
//values for actual time series chart (rectangle encompassing all digitalReadDots)
16+
float dot_x, dot_y, dot_h, dot_w;
1617
float plotBottomWell;
1718
float playbackWidgetHeight;
1819
int digitalReaddotHeight;
@@ -218,8 +219,8 @@ class DigitalReadDot{
218219
color dotStroke = #d2d2d2;
219220
color dot0Fill = #f5f5f5;
220221
color dot1Fill = #f5f5f5;
221-
color val0Fill = #000000;
222-
color val1Fill = #ffffff;
222+
color val0Fill = OPENBCI_DARKBLUE;
223+
color val1Fill = WHITE;
223224

224225
int dotX;
225226
int dotY;
@@ -256,7 +257,7 @@ class DigitalReadDot{
256257
padding = _padding;
257258

258259
digitalValue = new TextBox("", dotX, dotY);
259-
digitalValue.textColor = color(val0Fill);
260+
digitalValue.textColor = val0Fill;
260261
digitalValue.alignH = CENTER;
261262
digitalValue.alignV = CENTER;
262263
drawDigitalValue = true;

OpenBCI_GUI/W_EMG.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class W_emg extends Widget {
239239

240240
//draw channel number at upper left corner of row/column cell
241241
pushStyle();
242-
stroke(0);
242+
stroke(OPENBCI_DARKBLUE);
243243
fill(OPENBCI_DARKBLUE);
244244
int _chan = index+1;
245245
textFont(p5, 12);

OpenBCI_GUI/W_Focus.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class W_Focus extends Widget {
152152
if (false) {
153153
//Draw some guides to help develop this widget faster
154154
pushStyle();
155-
stroke(0);
155+
stroke(OPENBCI_DARKBLUE);
156156
//Main guides
157157
line(x, y+(h/2), x+w, y+(h/2));
158158
line(x+(w/2), y, x+(w/2), y+(h/2));

OpenBCI_GUI/W_HeadPlot.pde

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class HeadPlot {
324324
//initialize the image
325325
for (int Iy=0; Iy < headImage.height; Iy++) {
326326
for (int Ix = 0; Ix < headImage.width; Ix++) {
327-
headImage.set(Ix, Iy, OPENBCI_DARKBLUE);
327+
headImage.set(Ix, Iy, WHITE);
328328
}
329329
}
330330

@@ -992,7 +992,7 @@ class HeadPlot {
992992
headImage.set(Ix, Iy, calcPixelColor(Ix, Iy));
993993
} else { //negative values are outside of the head
994994
//pixel is outside the head. set to black.
995-
headImage.set(Ix, Iy, OPENBCI_DARKBLUE);
995+
headImage.set(Ix, Iy, WHITE);
996996
}
997997
}
998998
}
@@ -1004,32 +1004,17 @@ class HeadPlot {
10041004
//is this pixel inside the head?
10051005
if (electrode_color_weightFac[0][Ix][Iy] >= 0.0) { //zero and positive values are inside the head
10061006
//it is inside the head. set the color based on the electrodes
1007+
headVoltage[Ix][Iy] = calcPixelVoltage(Ix, Iy, headVoltage[Ix][Iy]);
10071008
headImage.set(Ix, Iy, calcPixelColor(headVoltage[Ix][Iy]));
10081009
} else { //negative values are outside of the head
10091010
//pixel is outside the head. set to black.
1010-
headImage.set(Ix, Iy, OPENBCI_DARKBLUE);
1011-
}
1012-
}
1013-
}
1014-
}
1015-
1016-
1017-
private void updateHeadVoltages() {
1018-
for (int Iy=0; Iy < headImage.height; Iy++) {
1019-
for (int Ix = 0; Ix < headImage.width; Ix++) {
1020-
//is this pixel inside the head?
1021-
if (electrode_color_weightFac[0][Ix][Iy] >= 0.0) { //zero and positive values are inside the head
1022-
//it is inside the head. set the voltage based on the electrodes
1023-
headVoltage[Ix][Iy] = calcPixelVoltage(Ix, Iy, headVoltage[Ix][Iy]);
1024-
} else { //negative values are outside of the head
1025-
//pixel is outside the head.
10261011
headVoltage[Ix][Iy] = -1.0;
1012+
headImage.set(Ix, Iy, WHITE);
10271013
}
10281014
}
10291015
}
10301016
}
10311017

1032-
int count_call=0;
10331018
private float calcPixelVoltage(int pixel_Ix, int pixel_Iy, float prev_val) {
10341019
float weight, elec_volt;
10351020
int n_elec = electrode_xy.length;
@@ -1225,7 +1210,6 @@ class HeadPlot {
12251210
} else {
12261211
//update head voltages
12271212
if (!threadLock && hardCalcsDone) {
1228-
updateHeadVoltages();
12291213
convertVoltagesToHeadImage();
12301214
}
12311215
}
@@ -1240,14 +1224,14 @@ class HeadPlot {
12401224
pushStyle();
12411225
smooth();
12421226
//draw head parts
1243-
fill(255, 255, 255);
1244-
stroke(125, 125, 125);
1227+
fill(WHITE);
1228+
stroke(GREY_125);
12451229
triangle(nose_x[0], nose_y[0], nose_x[1], nose_y[1], nose_x[2], nose_y[2]); //nose
12461230
ellipse(earL_x, earL_y, ear_width, ear_height); //little circle for the ear
12471231
ellipse(earR_x, earR_y, ear_width, ear_height); //little circle for the ear
12481232

12491233
//draw head itself
1250-
fill(255, 255, 255, 255); //fill in a white head
1234+
fill(WHITE); //fill in a white head
12511235
strokeWeight(1);
12521236
ellipse(circ_x, circ_y, circ_diam, circ_diam); //big circle for the head
12531237
if (drawHeadAsContours) {
@@ -1281,7 +1265,7 @@ class HeadPlot {
12811265
}
12821266

12831267
//add labels to electrodes
1284-
fill(0, 0, 0);
1268+
fill(OPENBCI_DARKBLUE);
12851269
textFont(font);
12861270
textAlign(CENTER, CENTER);
12871271
for (int i=0; i < electrode_xy.length; i++) {

OpenBCI_GUI/W_Networking.pde

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class W_Networking extends Widget {
324324
cp5_networking_dropdowns.draw();
325325

326326
int headerFontSize = 18;
327-
fill(0,0,0);// Background fill: white
327+
fill(OPENBCI_DARKBLUE);
328328
textFont(h1, headerFontSize);
329329

330330
if (!protocolMode.equals("Serial")) {
@@ -498,12 +498,12 @@ class W_Networking extends Widget {
498498
.setSize(120,20) // Size of textfield
499499
.setFont(createFont("Arial", 15, true))
500500
.setFocus(false) // Deselects textfield
501-
.setColor(color(26,26,26))
501+
.setColor(OPENBCI_DARKBLUE)
502502
.setColorBackground(color(255,255,255)) // text field bg color
503503
.setColorValueLabel(OPENBCI_DARKBLUE) // text color
504-
.setColorForeground(color(26,26,26)) // border color when not selected
504+
.setColorForeground(OPENBCI_DARKBLUE) // border color when not selected
505505
.setColorActive(isSelected_color) // border color when selected
506-
.setColorCursor(color(26,26,26))
506+
.setColorCursor(OPENBCI_DARKBLUE)
507507
.setText(default_text) // Default text in the field
508508
.setCaptionLabel("") // Remove caption label
509509
.setVisible(false) // Initially hidden

OpenBCI_GUI/W_PacketLoss.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class W_PacketLoss extends Widget {
134134
super.draw(); //calls the parent draw() method of Widget (DON'T REMOVE)
135135

136136
pushStyle();
137-
fill(0, 0, 0, 255);
137+
fill(OPENBCI_DARKBLUE);
138138
textFont(p5, 12);
139139
text("Session length: " + sessionTimeElapsed.toString(), x + padding, y + 15);
140140
text("Stream length: " + streamTimeElapsed.toString(), x + padding, y + 35);

OpenBCI_GUI/W_TimeSeries.pde

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class W_timeSeries extends Widget {
264264
//Display playback scrollbar, timeDisplay, or ADSSettingsController depending on data source
265265
if ((currentBoard instanceof FileBoard) && hasScrollbar) { //you will only ever see the playback widget in Playback Mode ... otherwise not visible
266266
pushStyle();
267-
fill(0,0,0,20);
267+
fill(GREY_20);
268268
stroke(31,69,110);
269269
rect(xF, ts_y + ts_h + playbackWidgetHeight + 5, wF, playbackWidgetHeight);
270270
popStyle();
@@ -1023,7 +1023,7 @@ class PlaybackScrollbar {
10231023

10241024
//select color for playback indicator
10251025
if (over || locked) {
1026-
fill(0, 0, 0);
1026+
fill(OPENBCI_DARKBLUE);
10271027
} else {
10281028
fill(102, 102, 102);
10291029
}
@@ -1033,7 +1033,7 @@ class PlaybackScrollbar {
10331033
//draw current timestamp and X of Y Seconds above scrollbar
10341034
int fontSize = 17;
10351035
textFont(p2, fontSize);
1036-
fill(0);
1036+
fill(OPENBCI_DARKBLUE);
10371037
float tw = textWidth(currentAbsoluteTimeToDisplay);
10381038
text(currentAbsoluteTimeToDisplay, xpos + swidth - tw, ypos - fontSize - 4);
10391039
text(currentTimeInSecondsToDisplay, xpos, ypos - fontSize - 4);
@@ -1105,7 +1105,7 @@ class TimeDisplay {
11051105
if (!currentAbsoluteTimeToDisplay.equals(null)) {
11061106
int fontSize = 17;
11071107
textFont(p2, fontSize);
1108-
fill(0);
1108+
fill(OPENBCI_DARKBLUE);
11091109
float tw = textWidth(currentAbsoluteTimeToDisplay);
11101110
text(currentAbsoluteTimeToDisplay, xpos + swidth - tw, ypos);
11111111
text(streamTimeElapsed.toString(), xpos + 10, ypos);

0 commit comments

Comments
 (0)