Get HSV array from color - Android Graphics

Android examples for Graphics:Color

Description

Get HSV array from color

Demo Code


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

public class Main {
    /**//from ww  w  . jav a  2s .  com
     * 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;
    }
}

Related Tutorials