Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.graphics.Color;

public class Main {
    public static int argb(String hexColorCode) {
        if (hexColorCode.startsWith("#"))
            hexColorCode = hexColorCode.substring(1);
        return (int) Long.parseLong(hexColorCode, 16);
    }

    public static int argb(int rgb, int alpha) {
        return Color.argb(alpha, Color.red(rgb), Color.green(rgb), Color.blue(rgb));
    }
}