diff --git a/lib.py b/lib.py index 3b9a23b..b456db9 100644 --- a/lib.py +++ b/lib.py @@ -13,12 +13,12 @@ class Pixel(namedtuple('Pixel', ['r', 'g', 'b'])): self.b + other.b, ) def __mul__(self, other): - if not isinstance(other, int) or not isinstance(other, float): + if not isinstance(other, int) and not isinstance(other, float): raise ValueError('Can only multiply by number') return Pixel( - other*pixel.r, - other*pixel.g, - other*pixel.b, + other*self.r, + other*self.g, + other*self.b, ) def weighted_average(p1, w1, p2, w2):