#NEWLINE# def _is_bright( rgb ) : #NEWLINE# #INDENT# 'Return whether a RGB color is bright or not.' #NEWLINE# ( r , g , b ) = rgb #NEWLINE# gray = ( ( ( 0.299 * g ) + ( 0.587 * g ) ) + ( 0.114 * b ) ) #NEWLINE# return ( gray >= 0.5 )