Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String hexToRgb(int color) {
        int c = (int) Long.parseLong(color + "", 16);
        String r = ((c >> 16) & 0xFF) + "";
        String g = ((c >> 8) & 0xFF) + "";
        String b = ((c >> 0) & 0xFF) + "";

        return r + g + b;
    }
}