src/codeandchords/Module.java
public void legend(int goalHuePos, int inputNum)
	{
		if(this.rectWidths == null)
		{
			this.curNumInputs		= Math.max(this.curNumInputs, 1);
			this.setSquareValues();
		}

		this.parent.textSize(Math.max(24 - (this.curNumInputs * 2), 8));

		String[]	legendText	= this.getLegendText();

		//		float	scale	= 1;
		//		if(this.menu.getIsRunning())	{	scale	= this.menu.getScale();	}
		float	scale	= this.menu.getCurrentScale();

		float	sideWidth1	=(this.rectWidths[inputNum] * scale) / legendText.length;
		float	sideHeight	= this.rectHeights[inputNum] / 10; //this.rectWidths[inputNum] / 12;	// pretty arbitrary
		float	addToLastRect	= (this.rectWidths[inputNum] * scale) - (sideWidth1 * legendText.length);
		float	sideWidth2	= sideWidth1;

		this.parent.noStroke();

		int	scaleDegree;
		float	xVal	= this.menu.mapCurrentXPos(this.xVals[inputNum]);
		float	yVal	= this.menu.mapCurrentYPos(this.yVals[inputNum] + this.rectHeights[inputNum]);

		for (int i = 0; i < legendText.length; i++)
		{
			if(i == legendText.length - 1)
			{
				sideWidth2	= sideWidth1 + addToLastRect;
			}

			// colors is filled all the way and only picked at the desired notes:
			scaleDegree	= this.scaleDegrees[this.menu.getMajMinChrom()][i];
			this.parent.fill(this.menu.getColors()[inputNum][scaleDegree][0], this.menu.getColors()[inputNum][scaleDegree][1], this.menu.getColors()[inputNum][scaleDegree][2]);

			if (i == goalHuePos) {
				this.parent.rect(xVal + (sideWidth1 * i), yVal - (sideHeight * 1.5f), sideWidth2, (sideHeight * 1.5f));
			} else {
				this.parent.rect(xVal + (sideWidth1 * i), yVal - sideHeight, sideWidth2, sideHeight);
			}

			this.parent.fill(0);			
			this.parent.text(legendText[i], (float) (xVal + (sideWidth1 * i) + (sideWidth1 * 0.3)), yVal - (sideHeight * 0.3f));

			if(debugLegendColors)
			{
				this.parent.textSize(12);
				this.parent.text(("r: " + this.menu.getColors()[inputNum][scaleDegree][0]), (float) (xVal + (sideWidth1 * i)) + 10, yVal - (sideHeight * 0.4f) - 50);
				this.parent.text(("g: " + this.menu.getColors()[inputNum][scaleDegree][1]), (float) (xVal + (sideWidth1 * i)) + 10, yVal - (sideHeight * 0.4f) - 40);
				this.parent.text(("b: " + this.menu.getColors()[inputNum][scaleDegree][2]), (float) (xVal + (sideWidth1 * i)) + 10, yVal - (sideHeight * 0.4f) - 30);
			}
		} // for - i

	}
/**
	 * Draws the legend at the bottom of the screen.
	 * 
	 * @param goalHuePos	current position, be that note or threshold level, in this Module's menu.colorSelect
	 */
Draws the legend at the bottom of the screen.

@param goalHuePos    current position, be that note or threshold level, in this Module's menu.colorSelect
Draws the legend at the bottom of the screen . @param goalHuePos current position be that note or threshold level in this Module ' s menu . colorSelect
public void legend(int goalHuePos, int inputNum)
	{
		if(this.rectWidths == null)
		{
			this.curNumInputs		= Math.max(this.curNumInputs, 1);
			this.setSquareValues();
		}
		this.parent.textSize(Math.max(24 - (this.curNumInputs * 2), 8));
		String[]	legendText	= this.getLegendText();
		float	scale	= this.menu.getCurrentScale();
		float	sideWidth1	=(this.rectWidths[inputNum] * scale) / legendText.length;
		float	sideHeight	= this.rectHeights[inputNum] / 10; 
		float	addToLastRect	= (this.rectWidths[inputNum] * scale) - (sideWidth1 * legendText.length);
		float	sideWidth2	= sideWidth1;
		this.parent.noStroke();
		int	scaleDegree;
		float	xVal	= this.menu.mapCurrentXPos(this.xVals[inputNum]);
		float	yVal	= this.menu.mapCurrentYPos(this.yVals[inputNum] + this.rectHeights[inputNum]);
		for (int i = 0; i < legendText.length; i++)
		{
			if(i == legendText.length - 1)
			{
				sideWidth2	= sideWidth1 + addToLastRect;
			}
			scaleDegree	= this.scaleDegrees[this.menu.getMajMinChrom()][i];
			this.parent.fill(this.menu.getColors()[inputNum][scaleDegree][0], this.menu.getColors()[inputNum][scaleDegree][1], this.menu.getColors()[inputNum][scaleDegree][2]);
			if (i == goalHuePos) {
				this.parent.rect(xVal + (sideWidth1 * i), yVal - (sideHeight * 1.5f), sideWidth2, (sideHeight * 1.5f));
			} else {
				this.parent.rect(xVal + (sideWidth1 * i), yVal - sideHeight, sideWidth2, sideHeight);
			}
			this.parent.fill(0);			
			this.parent.text(legendText[i], (float) (xVal + (sideWidth1 * i) + (sideWidth1 * 0.3)), yVal - (sideHeight * 0.3f));
			if(debugLegendColors)
			{
				this.parent.textSize(12);
				this.parent.text(("r: " + this.menu.getColors()[inputNum][scaleDegree][0]), (float) (xVal + (sideWidth1 * i)) + 10, yVal - (sideHeight * 0.4f) - 50);
				this.parent.text(("g: " + this.menu.getColors()[inputNum][scaleDegree][1]), (float) (xVal + (sideWidth1 * i)) + 10, yVal - (sideHeight * 0.4f) - 40);
				this.parent.text(("b: " + this.menu.getColors()[inputNum][scaleDegree][2]), (float) (xVal + (sideWidth1 * i)) + 10, yVal - (sideHeight * 0.4f) - 30);
			}
		} 
	}
public void legend ( int goalHuePos , int inputNum ) { if ( this . rectWidths == null ) { this . curNumInputs = Math . max ( this . curNumInputs , 1 ) ; this . setSquareValues ( ) ; } this . parent . textSize ( Math . max ( 24 - ( this . curNumInputs * 2 ) , 8 ) ) ; String [ ] legendText = this . getLegendText ( ) ; float scale = this . menu . getCurrentScale ( ) ; float sideWidth1 = ( this . rectWidths [ inputNum ] * scale ) / legendText . length ; float sideHeight = this . rectHeights [ inputNum ] / 10 ; float addToLastRect = ( this . rectWidths [ inputNum ] * scale ) - ( sideWidth1 * legendText . length ) ; float sideWidth2 = sideWidth1 ; this . parent . noStroke ( ) ; int scaleDegree ; float xVal = this . menu . mapCurrentXPos ( this . xVals [ inputNum ] ) ; float yVal = this . menu . mapCurrentYPos ( this . yVals [ inputNum ] + this . rectHeights [ inputNum ] ) ; for ( int i = 0 ; i < legendText . length ; i ++ ) { if ( i == legendText . length - 1 ) { sideWidth2 = sideWidth1 + addToLastRect ; } scaleDegree = this . scaleDegrees [ this . menu . getMajMinChrom ( ) ] [ i ] ; this . parent . fill ( this . menu . getColors ( ) [ inputNum ] [ scaleDegree ] [ 0 ] , this . menu . getColors ( ) [ inputNum ] [ scaleDegree ] [ 1 ] , this . menu . getColors ( ) [ inputNum ] [ scaleDegree ] [ 2 ] ) ; if ( i == goalHuePos ) { this . parent . rect ( xVal + ( sideWidth1 * i ) , yVal - ( sideHeight * 1.5f ) , sideWidth2 , ( sideHeight * 1.5f ) ) ; } else { this . parent . rect ( xVal + ( sideWidth1 * i ) , yVal - sideHeight , sideWidth2 , sideHeight ) ; } this . parent . fill ( 0 ) ; this . parent . text ( legendText [ i ] , ( float ) ( xVal + ( sideWidth1 * i ) + ( sideWidth1 * 0.3 ) ) , yVal - ( sideHeight * 0.3f ) ) ; if ( debugLegendColors ) { this . parent . textSize ( 12 ) ; this . parent . text ( ( "r: " + this . menu . getColors ( ) [ inputNum ] [ scaleDegree ] [ 0 ] ) , ( float ) ( xVal + ( sideWidth1 * i ) ) + 10 , yVal - ( sideHeight * 0.4f ) - 50 ) ; this . parent . text ( ( "g: " + this . menu . getColors ( ) [ inputNum ] [ scaleDegree ] [ 1 ] ) , ( float ) ( xVal + ( sideWidth1 * i ) ) + 10 , yVal - ( sideHeight * 0.4f ) - 40 ) ; this . parent . text ( ( "b: " + this . menu . getColors ( ) [ inputNum ] [ scaleDegree ] [ 2 ] ) , ( float ) ( xVal + ( sideWidth1 * i ) ) + 10 , yVal - ( sideHeight * 0.4f ) - 30 ) ; } } }
Draws the legend at the bottom of the screen.
Draws the legend at the bottom of the screen .
//		float	scale	= 1; //		if(this.menu.getIsRunning())	{	scale	= this.menu.getScale();	} //this.rectWidths[inputNum] / 12;	// pretty arbitrary // colors is filled all the way and only picked at the desired notes: // for - i