Skip to content

Commit

Permalink
reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Oct 16, 2024
1 parent 71ea907 commit 2c3a6dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/textual/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,13 @@ def tint(self, color: Color) -> Color:
Returns:
New color
"""
r2, g2, b2, a2, ansi2 = color
if ansi2 is not None:
return self

r1, g1, b1, a1, ansi1 = self
if ansi1 is not None:
return self
r2, g2, b2, a2, ansi2 = color
if ansi2 is not None:
return self
return Color(
int(r1 + (r2 - r1) * a2),
int(g1 + (g2 - g1) * a2),
Expand Down

0 comments on commit 2c3a6dc

Please sign in to comment.