Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Dec 4, 2024
1 parent 810117b commit f616550
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions coloraide/average.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def average(

# Get channel information
cs = obj.CS_MAP[space]
if cs.is_polar(): # type: ignore[attr-defined]
hue_index = cs.hue_index()
if cs.is_polar():
hue_index = cs.hue_index() # type: ignore[attr-defined]
has_radial = hasattr(cs, 'radial_index')
is_hwb = not has_radial and isinstance(cs, HWBish)
else:
Expand Down Expand Up @@ -93,9 +93,9 @@ def average(
color = obj.update(space, sums[:-1], sums[-1])
if cs.is_polar():
if has_radial and math.isnan(color[hue_index]):
color[cs.radial_index()] = 0
color[cs.radial_index()] = 0 # type: ignore[attr-defined]
elif is_hwb and math.isnan(color[hue_index]):
w, b = cs.indexes()[1:]
w, b = cs.indexes()[1:] # type: ignore[attr-defined]
if color[w] + color[b] < 1:
color[w] = 1 - color[b]
return color

0 comments on commit f616550

Please sign in to comment.