Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Color; public class Main { public static int convertNameToColor(String name) { name = name.substring(0, name.lastIndexOf('.')); return Color.parseColor(name); } }