Thu 15 Dec 2016 12:41:45 PM UTC, original submission:
There is an initialisation issue with alpha when you pass a '#RGB' hex string in the latest PyPi version 1.9
```
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tmx
>>> c = tmx.Color('#abcdef')
>>> c
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "tmx/__init__.py", line 797, in _repr_
return 'tmx.Color("{}")'.format(self.hex_string)
File "tmx/__init__.py", line 769, in hex_string
if self.alpha == 255:
File "tmx/__init__.py", line 761, in alpha
return self.__a
AttributeError: 'Color' object has no attribute '_Color__a'
```
I have attached a patch which inits alpha to 255 if the hex string passed is '#RGB'.
Also, the change to Color broke my project :P ! Would you consider printing just the hex string with _repr_ ? Like it worked in v1.8.1 when layer.color returned a hex color string.
|