Get color at specific hue angle, saturation and value - Android Graphics

Android examples for Graphics:Color Hue

Description

Get color at specific hue angle, saturation and value

Demo Code


import android.graphics.Color;

public class Main{
    /**//  ww  w  . j  ava2 s  .  com
     * Get color at specific hue angle, saturation and value
     * @param angle angle in degrees
     * @param saturation color saturation
     * @param value color value
     * @return color at specific hue angle, saturation and value
     */
    public static int getColorFromHSV(float angle, float saturation,
            float value) {
        angle = Utils.normalizeAngle(angle);
        return Color.HSVToColor(new float[] { angle, saturation, value });
    }
}

Related Tutorials