{"action":"created","issue":{"url":"https://api.github.com/repos/enthought/traitsui/issues/302","repository_url":"https://api.github.com/repos/enthought/traitsui","labels_url":"https://api.github.com/repos/enthought/traitsui/issues/302/labels{/name}","comments_url":"https://api.github.com/repos/enthought/traitsui/issues/302/comments","events_url":"https://api.github.com/repos/enthought/traitsui/issues/302/events","html_url":"https://github.com/enthought/traitsui/issues/302","id":174570537,"number":302,"title":"IndexError: tuple index out of range with ColorColumn","user":{"login":"JCorson","id":8750059,"avatar_url":"https://avatars.githubusercontent.com/u/8750059?v=3","gravatar_id":"","url":"https://api.github.com/users/JCorson","html_url":"https://github.com/JCorson","followers_url":"https://api.github.com/users/JCorson/followers","following_url":"https://api.github.com/users/JCorson/following{/other_user}","gists_url":"https://api.github.com/users/JCorson/gists{/gist_id}","starred_url":"https://api.github.com/users/JCorson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JCorson/subscriptions","organizations_url":"https://api.github.com/users/JCorson/orgs","repos_url":"https://api.github.com/users/JCorson/repos","events_url":"https://api.github.com/users/JCorson/events{/privacy}","received_events_url":"https://api.github.com/users/JCorson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/enthought/traitsui/labels/BUG","name":"BUG","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-01T16:38:23Z","updated_at":"2016-09-02T08:50:34Z","closed_at":null,"body":"I am getting the following error when running some sample code using `ColorColumn`:\r\n\r\n```\r\nIndexError                                Traceback (most recent call last)\r\n/Users/jcorson/Library/Enthought/Canopy/edm/envs/User/lib/python2.7/site-packages/traitsui/qt4/table_model.py in data(self, mi, role)\r\n     87 \r\n     88         if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:\r\n---> 89             text = column.get_value(obj)\r\n     90             if text is not None:\r\n     91                 return text\r\n\r\n/Users/jcorson/Library/Enthought/Canopy/edm/envs/User/lib/python2.7/site-packages/traitsui/color_column.py in get_value(self, object)\r\n     50         value = getattr( self.get_object( object ), self.name )\r\n     51         if type( value ) is tuple:\r\n---> 52             value = \"(%3d, %3d, %3d)\" % self._as_int_rgb_tuple( value[:-1] )\r\n     53         elif type( value ) is not str:\r\n     54             value = str( value )\r\n\r\n/Users/jcorson/Library/Enthought/Canopy/edm/envs/User/lib/python2.7/site-packages/traitsui/color_column.py in _as_int_rgb_tuple(self, color_values)\r\n     62         return ( int( 255 * color_values[0] ),\r\n     63                  int( 255 * color_values[1] ),\r\n---> 64                  int( 255 * color_values[2] ) )\r\n     65 \r\n```\r\nThis is using Traitsui 5.1.0.\r\nThe error seems to be caused by `value[:-1]` in color_column.py. Since `_as_int_rgb_tuple_()` returns specific indices in `color_values` is there a reason to not just call  `self._as_int_rgb_tuple(value)` in https://github.com/enthought/traitsui/blob/master/traitsui/color_column.py#L53 ?\r\n\r\nSample Code:\r\n\r\n```\r\nfrom traits.api import HasTraits, Str, Int, RGBColor, List\r\nfrom traitsui.api import View, Group, Item, TableEditor, ObjectColumn\r\nfrom traitsui.color_column import ColorColumn\r\n\r\n\r\nclass MyEntry(HasTraits):\r\n    name= Str()\r\n    value=Int(0)\r\n    color=RGBColor()\r\n    \r\n    entry_view = View(\r\n        Group(\r\n            Item('name'),\r\n            Item('value'),\r\n            Item('color')\r\n        )\r\n    )\r\n    \r\nmy_editor = TableEditor(\r\n    columns=[\r\n        ObjectColumn(name='name'),     \r\n        ObjectColumn(name='value'),\r\n        ColorColumn(name='color', style='readonly')\r\n    ],\r\n    orientation='vertical',\r\n    show_toolbar=True,\r\n    row_factory=MyEntry,\r\n)\r\n\r\nclass MyData(HasTraits):\r\n    data_list = List(MyEntry)\r\n\r\n    view=View(\r\n        Item(\r\n            'data_list',\r\n            editor=my_editor,\r\n            show_label=False\r\n        ), \r\n\r\n    )\r\n    \r\nif __name__ == '__main__':\r\n    d1 = MyEntry(name='a', value=2, color=(1.0, 0.3, 0.1))\r\n    d2 = MyEntry(name='b', value=3, color=(0.1, 0.0, 0.9))\r\n    data = MyData(data_list=[d1, d2])\r\n    \r\n    data.configure_traits()\r\n```"},"comment":{"url":"https://api.github.com/repos/enthought/traitsui/issues/comments/244319569","html_url":"https://github.com/enthought/traitsui/issues/302#issuecomment-244319569","issue_url":"https://api.github.com/repos/enthought/traitsui/issues/302","id":244319569,"user":{"login":"corranwebster","id":600761,"avatar_url":"https://avatars.githubusercontent.com/u/600761?v=3","gravatar_id":"","url":"https://api.github.com/users/corranwebster","html_url":"https://github.com/corranwebster","followers_url":"https://api.github.com/users/corranwebster/followers","following_url":"https://api.github.com/users/corranwebster/following{/other_user}","gists_url":"https://api.github.com/users/corranwebster/gists{/gist_id}","starred_url":"https://api.github.com/users/corranwebster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corranwebster/subscriptions","organizations_url":"https://api.github.com/users/corranwebster/orgs","repos_url":"https://api.github.com/users/corranwebster/repos","events_url":"https://api.github.com/users/corranwebster/events{/privacy}","received_events_url":"https://api.github.com/users/corranwebster/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T08:50:34Z","updated_at":"2016-09-02T08:50:34Z","body":"I can replicate this: thanks for the report."}}
{"actor":{"display_login":"corranwebster"}}