private static int hueToRGB( int mag1, int mag2, int Hue )
	{
		// check the range
		if( Hue < 0 )
		{
			Hue = Hue + HSLMAX;
		}
		else if( Hue > HSLMAX )
		{
			Hue = Hue - HSLMAX;
		}

		if( Hue < (HSLMAX / 6) )
		{
			return (mag1 + ((((mag2 - mag1) * Hue) + (HSLMAX / 12)) / (HSLMAX / 6)));
		}

		if( Hue < (HSLMAX / 2) )
		{
			return mag2;
		}

		if( Hue < ((HSLMAX * 2) / 3) )
		{
			return (mag1 + ((((mag2 - mag1) * (((HSLMAX * 2) / 3) - Hue)) + (HSLMAX / 12)) / (HSLMAX / 6)));
		}

		return mag1;
	}