1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-18 17:39:28 +08:00

Merge branch 'refs/heads/LmeSzinc/master' into dev

# Conflicts:
#	module/campaign/campaign_status.py
#	module/exercise/combat.py
#	module/retire/dock.py
#	module/retire/enhancement.py
This commit is contained in:
LA_DI_DA
2024-10-25 12:00:50 +08:00
217 changed files with 538 additions and 642 deletions

View File

@@ -965,6 +965,9 @@ def color_bar_percentage(image, area, prev_color, reverse=False, starter=0, thre
prev_row = bar[:, prev_index] > 255 - threshold
if not prev_row.size:
return prev_index / length
prev_color = np.mean(image[:, prev_index], axis=0)
# Look back 5px to get average color
left = max(prev_index - 5, 0)
mask = np.where(bar[:, left:prev_index + 1] > 255 - threshold)
prev_color = np.mean(image[:, left:prev_index + 1][mask], axis=0)
return 0.