Java tutorial
//package com.java2s; import android.graphics.Color; public class Main { /** * Get color code from a string * @param color The hex color string * @return The color code */ public static int getColor(String color) { return Color.parseColor(String.format("#%s", color)); } }