src/codeandchords/ModuleMenu.java
public void dichromatic_TwoRGB(int[] rgbVals1, int[] rgbVals2, int inputNum)
	{
		if(rgbVals1 == null || rgbVals2 == null) {
			throw new IllegalArgumentException("Module_01_02.dichromatic_TwoRGB: at least one of the float[] parameters is null.");
		} // error checking

		// Percent should be the percent of the difference between the first and second colors,
		// but the math doesn't work if we divide by 100 here, so that will happen later.
		float	percent		= 100 / this.scaleLength;

		// There will be a difference for red, green, and blue.
		//		float	difference;
		float	rDif	= rgbVals1[0] - rgbVals2[0];
		float	gDif	= rgbVals1[1] - rgbVals2[1];
		float	bDif	= rgbVals1[2] - rgbVals2[2];
/*
		System.out.println("Here we are in dichromatic!  rgbVals1 = rgb(" + rgbVals1[0] + ", "
				+ rgbVals1[1] + ", " + rgbVals1[2] + "); rgbVals2 = rgb(" + rgbVals2[0] + ", "
				+ rgbVals2[1] + ", " + rgbVals2[2] + "); "
				+ "\n\trDif = " + rDif + "; gDif = " + gDif + "; bDif = " + bDif);
*/
		// This array will hold the dichromatic spectrum:
		int[][]	dichromColors	= new int[this.scaleLength][3];
		
		// Fill dichromColors with the dichromatic spectrum:
		for(int i = 0; i < (dichromColors.length - 1); i++)
		{
			dichromColors[i][0]	= Math.round(rgbVals1[0] - (rDif * i * percent / 100));
			dichromColors[i][1]	= Math.round(rgbVals1[1] - (gDif * i * percent / 100));
			dichromColors[i][2]	= Math.round(rgbVals1[2] - (bDif * i * percent / 100));
		} // for - i
		
		// Fill the last position manually, in case the math rounds things too far and we don't quite get to it:
		for(int i = 0; i < rgbVals2.length; i++)
		{
			dichromColors[dichromColors.length - 1][i]	= rgbVals2[i];
		}

		// Now use scaleDegreeColors to fill this.colors with the dichrom spectrum at the appropriate positions for the current scale:
		int	dichromColorPos	= 0;

//		for(int i = this.startHere; i < this.endBeforeThis; i++)
//		{
			for(int j = 0; j < this.colors[inputNum].length && dichromColorPos < dichromColors.length; j++)
			{
				dichromColorPos	= this.getScaleDegreeColors()[this.majMinChrom][j];
	
				this.colors[inputNum][j]	= dichromColors[dichromColorPos];
			} // for - j
//		} // for - i

		this.fillHSBColors();

	}
/**
	 * This method fills colors with the spectrum of colors between the given rgb colors.
	 * 
	 * @param rgbVals1	float[] of rgb values defining tonicColor.
	 * @param rgbVals2	float[] of rgb values defining the color of the last note of the scale.
	 */
This method fills colors with the spectrum of colors between the given rgb colors.

@param rgbVals1      float[] of rgb values defining tonicColor.
@param rgbVals2      float[] of rgb values defining the color of the last note of the scale.
This method fills colors with the spectrum of colors between the given rgb colors . @param rgbVals1 float [] of rgb values defining tonicColor . @param rgbVals2 float [] of rgb values defining the color of the last note of the scale .
public void dichromatic_TwoRGB(int[] rgbVals1, int[] rgbVals2, int inputNum)
	{
		if(rgbVals1 == null || rgbVals2 == null) {
			throw new IllegalArgumentException("Module_01_02.dichromatic_TwoRGB: at least one of the float[] parameters is null.");
		} 
		float	percent		= 100 / this.scaleLength;
		float	rDif	= rgbVals1[0] - rgbVals2[0];
		float	gDif	= rgbVals1[1] - rgbVals2[1];
		float	bDif	= rgbVals1[2] - rgbVals2[2];
/*
		System.out.println("Here we are in dichromatic!  rgbVals1 = rgb(" + rgbVals1[0] + ", "
				+ rgbVals1[1] + ", " + rgbVals1[2] + "); rgbVals2 = rgb(" + rgbVals2[0] + ", "
				+ rgbVals2[1] + ", " + rgbVals2[2] + "); "
				+ "\n\trDif = " + rDif + "; gDif = " + gDif + "; bDif = " + bDif);
*/
		int[][]	dichromColors	= new int[this.scaleLength][3];
		for(int i = 0; i < (dichromColors.length - 1); i++)
		{
			dichromColors[i][0]	= Math.round(rgbVals1[0] - (rDif * i * percent / 100));
			dichromColors[i][1]	= Math.round(rgbVals1[1] - (gDif * i * percent / 100));
			dichromColors[i][2]	= Math.round(rgbVals1[2] - (bDif * i * percent / 100));
		} 
		for(int i = 0; i < rgbVals2.length; i++)
		{
			dichromColors[dichromColors.length - 1][i]	= rgbVals2[i];
		}
		int	dichromColorPos	= 0;
			for(int j = 0; j < this.colors[inputNum].length && dichromColorPos < dichromColors.length; j++)
			{
				dichromColorPos	= this.getScaleDegreeColors()[this.majMinChrom][j];
				this.colors[inputNum][j]	= dichromColors[dichromColorPos];
			} 
//		} 
		this.fillHSBColors();
	}
public void dichromatic_TwoRGB ( int [ ] rgbVals1 , int [ ] rgbVals2 , int inputNum ) { if ( rgbVals1 == null || rgbVals2 == null ) { throw new IllegalArgumentException ( "Module_01_02.dichromatic_TwoRGB: at least one of the float[] parameters is null." ) ; } float percent = 100 / this . scaleLength ; float rDif = rgbVals1 [ 0 ] - rgbVals2 [ 0 ] ; float gDif = rgbVals1 [ 1 ] - rgbVals2 [ 1 ] ; float bDif = rgbVals1 [ 2 ] - rgbVals2 [ 2 ] ; /*
		System.out.println("Here we are in dichromatic!  rgbVals1 = rgb(" + rgbVals1[0] + ", "
				+ rgbVals1[1] + ", " + rgbVals1[2] + "); rgbVals2 = rgb(" + rgbVals2[0] + ", "
				+ rgbVals2[1] + ", " + rgbVals2[2] + "); "
				+ "\n\trDif = " + rDif + "; gDif = " + gDif + "; bDif = " + bDif);
*/ int [ ] [ ] dichromColors = new int [ this . scaleLength ] [ 3 ] ; for ( int i = 0 ; i < ( dichromColors . length - 1 ) ; i ++ ) { dichromColors [ i ] [ 0 ] = Math . round ( rgbVals1 [ 0 ] - ( rDif * i * percent / 100 ) ) ; dichromColors [ i ] [ 1 ] = Math . round ( rgbVals1 [ 1 ] - ( gDif * i * percent / 100 ) ) ; dichromColors [ i ] [ 2 ] = Math . round ( rgbVals1 [ 2 ] - ( bDif * i * percent / 100 ) ) ; } for ( int i = 0 ; i < rgbVals2 . length ; i ++ ) { dichromColors [ dichromColors . length - 1 ] [ i ] = rgbVals2 [ i ] ; } int dichromColorPos = 0 ; for ( int j = 0 ; j < this . colors [ inputNum ] . length && dichromColorPos < dichromColors . length ; j ++ ) { dichromColorPos = this . getScaleDegreeColors ( ) [ this . majMinChrom ] [ j ] ; this . colors [ inputNum ] [ j ] = dichromColors [ dichromColorPos ] ; } this . fillHSBColors ( ) ; }
This method fills colors with the spectrum of colors between the given rgb colors.
This method fills colors with the spectrum of colors between the given rgb colors .
// error checking // Percent should be the percent of the difference between the first and second colors, // but the math doesn't work if we divide by 100 here, so that will happen later. // There will be a difference for red, green, and blue. //		float	difference; // This array will hold the dichromatic spectrum: // Fill dichromColors with the dichromatic spectrum: // for - i // Fill the last position manually, in case the math rounds things too far and we don't quite get to it: // Now use scaleDegreeColors to fill this.colors with the dichrom spectrum at the appropriate positions for the current scale: //		for(int i = this.startHere; i < this.endBeforeThis; i++) //		{ // for - j //		} // for - i