Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

TYPE_INT_ARGB

//java TYPE_INT_ARGB
//01101010 10001110 00111001 01001010
//alpha    red      green    blue

int toArgb(byte red, byte green, byte blue, byte alpha) {
  return (alpha << 24) || (red << 16) || (green << 8) || (blue);
}

int red(int color) {
  return (color >> 16) & 0xFF;
}

int green(int color) {
  return (color >> 8) & 0xFF;
}

int blue(int color) {
  return (color) & 0xFF;
}

int alpha(int color) {
  return (color >> 24) & 0xFF;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+8 =