Here you can find the source of rotateHue(Color color, float fraction)
public static Color rotateHue(Color color, float fraction)
//package com.java2s; /*/* w w w . j a v a2s. c o m*/ * BioJava development code * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. If you do not have a copy, * see: * * http://www.gnu.org/copyleft/lesser.html * * Copyright for this code is held jointly by the individual * authors. These should be listed in @author doc comments. * * For more information on the BioJava project and its aims, * or to join the biojava-l mailing list, visit the home page * at: * * http://www.biojava.org/ * * Created on May 20, 2010 * Author: Andreas Prlic * */ import java.awt.Color; public class Main { public static Color rotateHue(Color color, float fraction) { float af[] = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null); float hue = af[0]; float saturation = af[1]; float brightness = af[2]; //System.out.println(hue + " " + saturation + " " + brightness); float hueNew = hue + fraction; //System.out.println(hue + " " + hueNew); if (hueNew > 1) { hueNew = hueNew - 1; } return Color.getHSBColor(hueNew, saturation, brightness); } }