brogelio commited on
Commit
4323919
·
1 Parent(s): cdd0122

Updated Application File

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -109,23 +109,23 @@ def show(video): # main
109
  cv2.circle(rgb_image_f, idx_coords, 5, color, cv2.FILLED)
110
 
111
  if idx_coords[1] < 72: # brute force but should be extremely marginally faster lol
112
- if idx_coords[0] < 142: # red
113
  color = (0, 0, 255)
114
- if 142 < idx_coords[0] < 285: # orange
115
  color = (0, 115, 255)
116
- if 285 < idx_coords[0] < 426: # yellow
117
  color = (0, 229, 255)
118
- if 426 < idx_coords[0] < 569: # green
119
  color = (0, 195, 88)
120
- if 569 < idx_coords[0] < 711: # blue
121
  color = (195, 85, 0)
122
- if 711 < idx_coords[0] < 853: # indigo
123
  color = (195, 0, 68)
124
- if 853 < idx_coords[0] < 996: # violet
125
  color = (195, 0, 143)
126
- if 996 < idx_coords[0] < 1137: # black
127
  color = (0, 0, 0)
128
- if 1137 < idx_coords[0]: # white / eraser
129
  color = (255, 255, 255)
130
 
131
  if len(past_holder) and drawing_flag: # start drawing
 
109
  cv2.circle(rgb_image_f, idx_coords, 5, color, cv2.FILLED)
110
 
111
  if idx_coords[1] < 72: # brute force but should be extremely marginally faster lol
112
+ if idx_coords[0] < 71: # red
113
  color = (0, 0, 255)
114
+ if 71 < idx_coords[0] < 142: # orange
115
  color = (0, 115, 255)
116
+ if 142 < idx_coords[0] < 213: # yellow
117
  color = (0, 229, 255)
118
+ if 213 < idx_coords[0] < 284: # green
119
  color = (0, 195, 88)
120
+ if 284 < idx_coords[0] < 356: # blue
121
  color = (195, 85, 0)
122
+ if 356 < idx_coords[0] < 427: # indigo
123
  color = (195, 0, 68)
124
+ if 427 < idx_coords[0] < 498: # violet
125
  color = (195, 0, 143)
126
+ if 498 < idx_coords[0] < 569: # black
127
  color = (0, 0, 0)
128
+ if 569 < idx_coords[0]: # white / eraser
129
  color = (255, 255, 255)
130
 
131
  if len(past_holder) and drawing_flag: # start drawing