doFuncGColorBGR static method
Implementation
static int doFuncGColorBGR( int rgb, List<int> bgrColorArray ){
int i, j;
int r = (rgb & 0xFF0000) >> 16;
int g = (rgb & 0x00FF00) >> 8;
int b = rgb & 0x0000FF;
int rr, gg, bb, tmp;
int d = 766/*255*3+1*/;
j = 0;
for( i = 0; i < 256; i++ ){
rr = bgrColorArray[i] & 0x0000FF;
gg = (bgrColorArray[i] & 0x00FF00) >> 8;
bb = (bgrColorArray[i] & 0xFF0000) >> 16;
tmp = (ClipMath.abs( (rr - r).toDouble() ) + ClipMath.abs( (gg - g).toDouble() ) + ClipMath.abs( (bb - b).toDouble() )).toInt();
if( tmp < d ){
j = i;
d = tmp;
}
}
return j;
}