Java examples for 2D Graphics:Color
get Color Hue
/** Copyright by Barry G. Becker, 2000-2011. Licensed under MIT License: http://www.opensource.org/licenses/MIT */ //package com.java2s; import java.awt.*; public class Main { /**//from w w w .j a va2s. c om * * @param color * @return the hue (in HSB space) for a given color. */ public static float getColorHue(Color color) { float[] hsv = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null); return hsv[0]; } }