Skip to content

isof.fillareacolors does not like rgb tuple in list of colors #206

Description

@doutriaux1
import vcs
gm = vcs.createisofill()
gm.fillareacolors = [ 45, 46, [255,255,255],56]

leads to

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-043c6fd1e783> in <module>()
      1 gm = vcs.createisofill()
----> 2 gm.fillareacolors = [ 45, 46, [255,255,255],56]

/git/vcs/vcs/__init__.pyc in __setattr__(self, a, v)
     54     def __setattr__(self, a, v):
     55         if not hasattr(self, "__slots__") or a in self.__slots__:
---> 56             super(bestMatch, self).__setattr__(a, v)
     57         else:
     58             matches = difflib.get_close_matches(a, self.__slots__)

/git/vcs/vcs/VCS_validation_functions.pyc in _setfillareacolors(self, value)
   2121             self,
   2122             'fillareacolors',
-> 2123             value)
   2124     self._fillareacolors = value
   2125 fillareacolors = property(_getfillareacolors, _setfillareacolors)  # noqa

/git/vcs/vcs/VCS_validation_functions.pyc in checkColorList(self, name, value)
    776                 '_list_value',
    777                 v,
--> 778                 NoneOk=True))
    779     return returned_values
    780 

/git/vcs/vcs/VCS_validation_functions.pyc in checkColor(self, name, value, NoneOk)
    750                                    minvalue=0, maxvalue=100.,
    751                                    minelements=3,
--> 752                                    maxelements=4)
    753         if len(value) == 3:
    754             value.append(100.)

/git/vcs/vcs/VCS_validation_functions.pyc in checkListOfNumbers(self, name, value, minvalue, maxvalue, minelements, maxelements, ints)
    240             checkInt(self, name, v, minvalue=minvalue, maxvalue=maxvalue)
    241         else:
--> 242             checkNumber(self, name, v, minvalue=minvalue, maxvalue=maxvalue)
    243     return list(value)
    244 

/git/vcs/vcs/VCS_validation_functions.pyc in checkNumber(self, name, value, minvalue, maxvalue)
    195             name +
    196             ' values must be at most ' +
--> 197             str(maxvalue))
    198     return value
    199 

/git/vcs/vcs/VCS_validation_functions.pyc in checkedRaise(self, value, ex, err)
     57     if vcs._doValidation:
     58         if err is not None:
---> 59             raise ex(err)
     60         else:
     61             raise ex

ValueError: fillareacolors_list_value values must be at most 100.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions