@classmethod\r
def fromCOLORREF(cls,c):\r
"""factory method to create an RGB from a COLORREF ctypes instance"""\r
- if not isinstance(c,COLORREF): raise ValueError("%s is not a COLORREF instance"%c)\r
- return cls(c.value&0xff,(c.value<<8)&0xff,(c.value<<16)&0xff)\r
+ if isinstance(c,COLORREF):\r
+ c=c.value\r
+ return cls(c&0xff,(c>>8)&0xff,(c>>16)&0xff)\r
\r
_re_RGBFunctionString=re.compile(r'rgb\(\s*(\d+%?)\s*,\s*(\d+%?)\s*,\s*(\d+%?)\s*\)',re.I)\r
_re_RGBAFunctionString=re.compile(r'rgba\(\s*(\d+%?)\s*,\s*(\d+%?)\s*,\s*(\d+%?)\s*,\s*\d+(\.\d+)?\s*\)',re.I)\r