Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.graphics.Color; public class Main { public static float colorToHSV(Context context, int colorResourceId) { int color = context.getResources().getColor(colorResourceId); int a = Color.alpha(color); int r = Color.red(color); int g = Color.green(color); int b = Color.blue(color); float[] hsv = new float[3]; Color.RGBToHSV(r, g, b, hsv); return hsv[0]; } }