bugPython TMX Library - Bugs: bug #49850, Color class alpha uninitialised

 
 

bug #49850: Color class alpha uninitialised

Submitted by:  None
Submitted on:  Thu 15 Dec 2016 12:41:45 PM UTC  
 
Severity: 4 - ImportantStatus: Fixed
Assigned to: Julie Marchant <onpon4>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 15 Dec 2016 11:50:39 PM UTC, comment #2:

Alright, version 1.9.1 has been released.

Julie Marchant <onpon4>
Project AdministratorIn charge of this item.
Thu 15 Dec 2016 01:27:50 PM UTC, comment #1:

Thanks for the report. I've fixed both issues in the Git repo and will release version 1.9.1 shortly.

Julie Marchant <onpon4>
Project AdministratorIn charge of this item.
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.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #39233:  alpha_init.patch added by None (606B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by onpon4 (Posted a comment)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 15 Dec 2016 11:50:39 PM UTConpon4StatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Thu 15 Dec 2016 01:27:50 PM UTConpon4Severity3 - Normal=>4 - Important
      StatusNone=>In Progress
      Assigned toNone=>onpon4
    Thu 15 Dec 2016 12:41:45 PM UTCNoneAttached File-=>Added alpha_init.patch, #39233

    Back to the top


    Powered by Savane 3.1-cleanup1