#NEWLINE# def collapseRGBAToRGB( self , rgba ) : #NEWLINE# #INDENT# RGB = '([0-9]|([1-9][0-9])|(1[0-9][0-9])|(2[0-4][0-9])|(25[0-5]))' #NEWLINE# A = '(0|1|(1[.]0*)|(0[.][0-9]*)|([.][0-9]+))' #NEWLINE# RGBA_PATTERN = ( ( ( ( ( ( ( ( 'rgba[(]' + RGB ) + '[,]' ) + RGB ) + '[,]' ) + RGB ) + '[,]' ) + A ) + '[)]' ) #NEWLINE# result = rgba #NEWLINE# if ( ( None != rgba ) and rgba . startswith ( 'rgba(' ) ) : #NEWLINE# #INDENT# rp = re . compile ( RGB ) #NEWLINE# if rp . match ( rgba ) : #NEWLINE# #INDENT# FIRST_PAREN = 4 #NEWLINE# lastComma = rgba . rfind ( ',' ) #NEWLINE# result = ( ( 'rgb' + rgba [ FIRST_PAREN : lastComma ] ) + ')' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise IllegalArgumentException ( ( ( ( ( ( "Your RGBA color specification: '" + rgba ) + "'" ) + ' was not in the GChart-required form: rgba(Red,Green,Blue,Alpha)' ) + ' where Red, Green and Blue are integers in the range 0 to 255 and' ) + ' Alpha is a double in the range 0.0 to 1.0' ) ) #NEWLINE# #UNINDENT# #UNINDENT# return result