이 때 자바의 경우 unsigned의 값이 없으므로 short의 값을 읽어 들이는 경우의 처리를 위해 &0x1f를 해준다.
int red, green, blue;
short color; //16bit color
red = (color >>>10) &0x1f;
green = (color >>>5)&0x1f;
blue = (color &0x1f);
Color newColor = new Color(red, green, blue);
short color; //16bit color
red = (color >>>10) &0x1f;
green = (color >>>5)&0x1f;
blue = (color &0x1f);
Color newColor = new Color(red, green, blue);
그러나, 이를 바로 적용하는 경우에는 명도(?)의 값이 낮게 되므로 어둡게 나오게 된다. 따라서 8bit로 표현할 수 있는 값에 맞게 5bit의 값을 비례시켜줘야 한다.
int red, green, blue;
short color; //16bit color
red = ((color >>>10) &0x1f )*8;
green = ((color >>>5)&0x1f)*8;
blue = (color &0x1f)*8;
Color newColor = new Color(red, green, blue);
short color; //16bit color
red = ((color >>>10) &0x1f )*8;
green = ((color >>>5)&0x1f)*8;
blue = (color &0x1f)*8;
Color newColor = new Color(red, green, blue);
도움을 주신 공룡잡이 님과 먀님께 감사를 드리며~
아 그게 16비트 비트맵이란 놈이였군요.. ㅎㅎ
답글삭제그렇죠 ^^
답글삭제흠.. 파이어폭스에서 보는 스킨의 모습은 그렇게 안예쁘군요.. 바꿀 때가 되었나봐요 ㅋㅋ