static double luma ( double color ) { long argb = Double . doubleToRawLongBits ( color ) ; double r = ( ( argb >> 32 ) & 0xFFFF ) / ( double ) 0xFF00 ; double g = ( ( argb >> 16 ) & 0xFFFF ) / ( double ) 0xFF00 ; double b = ( ( argb ) & 0xFFFF ) / ( double ) 0xFF00 ; r = ( r <= 0.03928 ) ? r / 12.92 : Math . pow ( ( ( r + 0.055 ) / 1.055 ) , 2.4 ) ; g = ( g <= 0.03928 ) ? g / 12.92 : Math . pow ( ( ( g + 0.055 ) / 1.055 ) , 2.4 ) ; b = ( b <= 0.03928 ) ? b / 12.92 : Math . pow ( ( ( b + 0.055 ) / 1.055 ) , 2.4 ) ; return 0.2126 * r + 0.7152 * g + 0.0722 * b ; }
The less function luma .