Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java get color from rgb values

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

rgb code from java color

String.format("#%06x", color.getRGB() & 0x00FFFFFF)
Comment

PREVIOUS NEXT
Code Example
Java :: Java remove element at position from array and shift 
Java :: int array to map java 
Java :: how to uncomment a block of statements in java 
Java :: what is abstract class 
Java :: Add an element at a specified position in an ArrayList 
Java :: quick way to get charAt 
Java :: recursion java 
Java :: executors java 
Java :: interface in java 
Java :: java recursion 
Java :: set preference value android 
Java :: string.replace in java 
Java :: check if string is decimal java 
Java :: find number of weeks between two dates in java 
Java :: java final class 
Java :: lombok 
Java :: number of matches regex java 
Java :: configuration spring boot dependency for freemarker configuration 
Java :: public class extends implements java 
Java :: code wars jaden casting java 
Java :: java read from connection even if 404 
Sql :: mysql last 7 days including today 
Sql :: loading local data is disabled mysql 
Sql :: postgresql server restart 
Sql :: set max_allowed_packet mysql 
Sql :: mysql query to get column names 
Sql :: sqlite alter table add column 
Sql :: install mysql on mac 
Sql :: sql query to make a existing column auto increment 
Sql :: Find all tables containing column with specified name - MS SQL Server 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =