Add color_rgba helper for gradient stops

This commit is contained in:
Robin Dunn
2019-07-27 17:34:23 -07:00
parent f0a0f8a65c
commit efd8d48b42

View File

@@ -518,6 +518,15 @@ cdef class SVGgradientStop:
self._check_ptr()
return self._ptr.color
@property
def color_rgba(self) -> tuple:
""" Returns color as a RGBA tuple """
c = self.color
return ( c & 0xff,
(c >> 8) & 0xff,
(c >> 16) & 0xff,
(c >> 24) & 0xff)
@property
def offset(self) -> float:
self._check_ptr()