Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java ints to color int

public int getIntFromColor(int Red, int Green, int Blue){
    Red = (Red << 16) & 0x00FF0000; //Shift red 16-bits and mask out other stuff
    Green = (Green << 8) & 0x0000FF00; //Shift Green 8-bits and mask out other stuff
    Blue = Blue & 0x000000FF; //Mask out anything not blue.

    return 0xFF000000 | Red | Green | Blue; //0xFF000000 for 100% Alpha. Bitwise OR everything together.
}
Comment

PREVIOUS NEXT
Code Example
Java :: new keyword in java 
Java :: java get element occurrences in a list java 
Java :: java download for windows 10 
Java :: cant change button color when app run android studio 
Java :: Example of Creating a Java Stack 
Java :: Java List Add Elements using add() method 
Java :: kruskal java 
Java :: Java Create a BufferedOutputStream 
Java :: Fix arabic javafx 
Java :: java letter to number 
Java :: single dex file error android 
Java :: int to char java 
Java :: lcm of two large positive integers java 
Java :: alphabet n vowelin java 
Java :: ArrayList of prime numbers 
Java :: org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:876) 
Java :: how to create a console in java gui 
Java :: default case in Java switch-case 
Java :: int[] java 
Java :: declare id in java 
Java :: java determine number of cpu cores 
Java :: foreach skip to next java 
Java :: treemap java entryset 
Java :: could not load main class java 
Java :: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 
Java :: spring boot embedded tomcat port already in use 
Java :: spring logback configuration 
Java :: how to get string value in java in android 
Java :: java loop through array 
Java :: Java if...else Statement 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =