Skip to content

Commit

Permalink
Merge pull request #481 from coolkiid/p/coolkiid/fix-argument-type
Browse files Browse the repository at this point in the history
fix: add type conversion to fix wrong argument type (#480)
  • Loading branch information
Zzaphkiel authored Oct 6, 2024
2 parents 233c231 + 5b8eeb1 commit 76ae91a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/common/style_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,11 @@ def __getStyleSheetColor(color: QColor):
r, g, b, a = color.getRgb()

f1, f2 = 1.1, 0.9
r1, g1, b1 = min(r * f1, 255), min(g * f1, 255), min(b * f1, 255)
r2, g2, b2 = min(r * f2, 255), min(g * f2, 255), min(b * f2, 255)
a1, a2 = min(a + 25, 255), min(a + 50, 255)

type_conversion = lambda x: int(x)
r1, g1, b1 = map(type_conversion, [min(r * f1, 255), min(g * f1, 255), min(b * f1, 255)])
r2, g2, b2 = map(type_conversion, [min(r * f2, 255), min(g * f2, 255), min(b * f2, 255)])
a1, a2 = map(type_conversion, [min(a + 25, 255), min(a + 50, 255)])

c1 = QColor.fromRgb(r1, g1, b1, a1)
c2 = QColor.fromRgb(r2, g2, b2, a2)
Expand Down

0 comments on commit 76ae91a

Please sign in to comment.