public void initRGBbyHSL( int H, int S, int L )
	{
		int Magic1;
		int Magic2;

		pHue = H;
		pLum = L;
		pSat = S;

		if( S == 0 )
		{ //Greyscale
			pRed = (L * RGBMAX) / HSLMAX; //luminescence: set to range
			pGreen = pRed;
			pBlue = pRed;
		}
		else
		{
			if( L <= (HSLMAX / 2) )
			{
				Magic2 = ((L * (HSLMAX + S)) + (HSLMAX / 2)) / (HSLMAX);
			}
			else
			{
				Magic2 = L + S - ((L * S) + (HSLMAX / 2)) / HSLMAX;
			}
			Magic1 = 2 * L - Magic2;

			//get R, G, B; change units from HSLMAX range to RGBMAX range
			pRed = ((hueToRGB( Magic1, Magic2, H + (HSLMAX / 3) ) * RGBMAX) + (HSLMAX / 2)) / HSLMAX;
			if( pRed > RGBMAX )
			{
				pRed = RGBMAX;
			}

			pGreen = ((hueToRGB( Magic1, Magic2, H ) * RGBMAX) + (HSLMAX / 2)) / HSLMAX;
			if( pGreen > RGBMAX )
			{
				pGreen = RGBMAX;
			}

			pBlue = ((hueToRGB( Magic1, Magic2, H - (HSLMAX / 3) ) * RGBMAX) + (HSLMAX / 2)) / HSLMAX;
			if( pBlue > RGBMAX )
			{
				pBlue = RGBMAX;
			}
		}
	}