Added property name setters in Color __init__

This commit is contained in:
Alexander Taylor 2014-12-24 14:48:58 +00:00
parent 61944c4c78
commit 5eb0aa6c28
1 changed files with 6 additions and 0 deletions

View File

@ -225,6 +225,12 @@ cdef class Color(ContextInstruction):
else:
self.set_state('color', [1.0, 1.0, 1.0, 1.0])
for property_name in ['r', 'g', 'b', 'a',
'rgb', 'rgba', 'hsv',
'h', 's', 'v']:
if property_name in kwargs:
setattr(self, property_name, kwargs['property_name'])
property rgba:
'''RGBA color, list of 4 values in 0-1 range.
'''