Rzx008 commited on
Commit
785585e
·
verified ·
1 Parent(s): 8e5b8a6

Update android.py

Browse files
Files changed (1) hide show
  1. 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
- brightness = (bg_color[0] * 299 + bg_color[1] * 587 + bg_color[2] * 114) / 1000
37
- return brightness < 128
 
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)