public static int[] getIntARGB(int argb){
int result[] = new int[4];
result[0] = (argb & 0xff000000) >> 24;
result[1] = (argb & 0x00FF0000) >> 16;
result[2] = (argb & 0x0000FF00) >> 8;
result[3] = (argb & 0x000000FF);
return result;
}
public static int getARBGInt(int a, int r, int g, int b) {
return ((a << 24) | 0xFF) + ((r << 16) | 0xFF) + ((g << 8) | 0xFF) + (b | 0xFF);
}
Do you have any idea why if I take an argb int then decomposed it and repose it , it does not return the same value ?
One of this two (or both) function are messed up in a way but I don't know why (of course it would be stupid to just decompose and recompose the same argb value I want to modify if before but if there is a problem already I can't work x) )
public static int getARBGInt(int a, int r, int g, int b) {
return (a << 24) + (r << 16) + (g << 8) + b;
}
I have accidentily put " | 0xFF " on the result of the << ...
User contributions licensed under CC BY-SA 3.0