pypdflite/pdfobjects/pdfcolor.py
def _is_equal(self, test_color):
        """Equality test"""
        if test_color is None:
            ans = False
        elif test_color.color_type != self.color_type:
            ans = False
        elif self.name is not None and self.name == test_color.name:
            ans = True
        elif (self.red == test_color.red and
              self.blue == test_color.blue and
              self.green == test_color.green):
            ans = True
        else:
            ans = False
        return ans
def _is_equal(self, test_color):
        """Equality test"""
        if test_color is None:
            ans = False
        elif test_color.color_type != self.color_type:
            ans = False
        elif self.name is not None and self.name == test_color.name:
            ans = True
        elif (self.red == test_color.red and
              self.blue == test_color.blue and
              self.green == test_color.green):
            ans = True
        else:
            ans = False
        return ans
Equality test