def contains(self, clr):
if not isinstance(clr, Color):<EOL><INDENT>return False<EOL><DEDENT>if not isinstance(clr, _list):<EOL><INDENT>clr = [clr]<EOL><DEDENT>for clr in clr:<EOL><INDENT>if clr.is_grey and not self.grayscale:<EOL><INDENT>return (self.black.contains(clr) orself.white.contains(clr))<EOL><DEDENT>for r, v in [(self.h, clr.h), (self.s, clr.s), (self.b, clr.brightness), (self.a, clr.a)]:<EOL><INDENT>if isinstance(r, _list):<EOL><INDENT>pass<EOL><DEDENT>elif isinstance(r, tuple):<EOL><INDENT>r = [r]<EOL><DEDENT>else:<EOL><INDENT>r = [(r, r)]<EOL><DEDENT>for min, max in r:<EOL><INDENT>if not (min <= v <= max):<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return True<EOL>
Returns True if the given color is part of this color range.

Check whether each h, s, b, a component of the color
falls within the defined range for that component.

If the given color is grayscale,
checks against the definitions for black and white.