Spaces:
Paused
Paused
Update android.py
Browse files- android.py +3 -2
android.py
CHANGED
|
@@ -33,8 +33,9 @@ class AndroidEditor:
|
|
| 33 |
@staticmethod
|
| 34 |
def is_dark_mode(bg_color):
|
| 35 |
"""Mendeteksi apakah background menggunakan dark mode berdasarkan kecerahan warna"""
|
| 36 |
-
|
| 37 |
-
|
|
|
|
| 38 |
|
| 39 |
def process_image(self, image_path, anggota):
|
| 40 |
image = cv2.imread(image_path)
|
|
|
|
| 33 |
@staticmethod
|
| 34 |
def is_dark_mode(bg_color):
|
| 35 |
"""Mendeteksi apakah background menggunakan dark mode berdasarkan kecerahan warna"""
|
| 36 |
+
r, g, b = float(bg_color[0]), float(bg_color[1]), float(bg_color[2])
|
| 37 |
+
brightness = (r * 299 + g * 587 + b * 114) / 1000
|
| 38 |
+
return brightness < 128
|
| 39 |
|
| 40 |
def process_image(self, image_path, anggota):
|
| 41 |
image = cv2.imread(image_path)
|