Android examples for Graphics:Color Value
Get value from color
//package com.java2s; import android.graphics.Color; public class Main { /**/*from www.ja va 2s .co m*/ * Get value from color * @param color color * @return color value, 0..1 */ public static float getValueFromColor(int color) { return getHSVFromColor(color)[2]; } /** * Get HSV array from color * @param color color * @return HSV array, length = 3 */ public static float[] getHSVFromColor(int color) { float hsv[] = new float[3]; Color.colorToHSV(color, hsv); return hsv; } }