Search
 
SCRIPT & CODE EXAMPLE
 

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;
}
Comment

PREVIOUS NEXT
Code Example
Java :: minecraft block java 
Java :: java replace ignore case 
Java :: leerzeichen ersetzen java 
Java :: add pd4j to application 
Java :: firemonkey android ini file read 
Java :: java list sort comparator date descending lambda 
Java :: java 8 anymatch two lists 
Java :: java spigot string to kyori textcomponent 
Java :: Android popBackStack to specific fragment 
Java :: Mirror Inverse Program in java 
Java :: infinite loop in java 
Java :: scanner class in java 
Java :: draaiom 
Java :: Goodbye to "Inspect Element" 
Java :: domain validation test spring boot 
Java :: random number in java between 10 and 20 
Java :: ban vs sri 
Java :: @android:color/system_neutral1_1000 
Java :: stringbuffer concatenation in java 
Java :: java vererbung methoden 
Java :: Could not find com.commercehub.gradle.plugin:gradle-avro-plugin:0.10.0. 
Java :: ferrari class in java 
Java :: java package naming convention plural singular 
Java :: origin model color 
Java :: java singleton design pattern 
Java :: java class creation inside method 
Java :: java max array 
Java :: java polymorphism nedir 
Java :: binary search program in java 
Java :: palindrome in java 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =