private static float hslConvert ( float t1 , float t2 , float hue ) { float value ; if ( hue < 0 ) { hue += 6 ; } if ( hue >= 6 ) { hue -= 6 ; } if ( hue < 1 ) { value = ( t2 - t1 ) * hue + t1 ; } else if ( hue < 3 ) { value = t2 ; } else if ( hue < 4 ) { value = ( t2 - t1 ) * ( 4 - hue ) + t1 ; } else { value = t1 ; } return value ; }
HSL convert helper method