Update app.py
Browse files
app.py
CHANGED
@@ -35,9 +35,9 @@ keys = [
|
|
35 |
COLORS = {
|
36 |
'KEY_IDLE': (75, 75, 75), # Darker gray for idle keys
|
37 |
'KEY_HOVER': (100, 100, 255), # Blue highlight for hover
|
38 |
-
'KEY_PRESS': (
|
39 |
'TEXT_NORMAL': (255, 255, 255), # White text
|
40 |
-
'TEXT_PRESS': (
|
41 |
'OUTPUT_BG': (45, 45, 45), # Dark gray for output background
|
42 |
}
|
43 |
|
@@ -152,6 +152,7 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
152 |
button.is_pressed=False
|
153 |
if x < x8 < x + bw and y < y8 < y + bh:
|
154 |
button.is_hover = True
|
|
|
155 |
cv2.rectangle(img, (x, y), (x + bw, y + bh), color, -1, cv2.LINE_AA)
|
156 |
cv2.putText(img, button.text, (x + int(0.2 * bw), y + int(0.7 * bh)), cv2.FONT_HERSHEY_PLAIN, font_scale, text_color, font_thickness)
|
157 |
|
|
|
35 |
COLORS = {
|
36 |
'KEY_IDLE': (75, 75, 75), # Darker gray for idle keys
|
37 |
'KEY_HOVER': (100, 100, 255), # Blue highlight for hover
|
38 |
+
'KEY_PRESS': (50, 200, 50), # Green for pressed keys
|
39 |
'TEXT_NORMAL': (255, 255, 255), # White text
|
40 |
+
'TEXT_PRESS': (0, 0, 0), # Black text when pressed
|
41 |
'OUTPUT_BG': (45, 45, 45), # Dark gray for output background
|
42 |
}
|
43 |
|
|
|
152 |
button.is_pressed=False
|
153 |
if x < x8 < x + bw and y < y8 < y + bh:
|
154 |
button.is_hover = True
|
155 |
+
button.is_pressed = False
|
156 |
cv2.rectangle(img, (x, y), (x + bw, y + bh), color, -1, cv2.LINE_AA)
|
157 |
cv2.putText(img, button.text, (x + int(0.2 * bw), y + int(0.7 * bh)), cv2.FONT_HERSHEY_PLAIN, font_scale, text_color, font_thickness)
|
158 |
|