package rainbowPackage;

//import javafx.scene.paint.Paint.*;
import javafx.scene.paint.Color;
//import rainbowPackage.VibrantColors;
//import rainbowPackage.VibrantColorCombos;

public final class RainbowSoftColor //For All Rainbows To Be Defined Using Multiple ColorSlider.java Classes Involving Rainbow Color And Color Sequences In This Class; RainbowSoftColor.java
{
	ColorSlider black = new ColorSlider( new double[]{0,0,0} );
	ColorSlider white = new ColorSlider( new double[]{255,255,255} );

	ColorSlider color = black;
	ColorSlider tempColor = white;

	TransparencySlider colorTransparency = new TransparencySlider( new double[]{0,0,0,1} );
	TransparencySlider tempColorTransparency = new TransparencySlider( new double[]{255,255,255,1} );

	Color customColors[] = new Color[] { Color.BLACK, Color.WHITE };

	ColorSlider skyblue = new ColorSlider( new double[]{134,206,249} );
	ColorSlider oxylblue = new ColorSlider( new double[]{0,255,255} );
	ColorSlider pink = new ColorSlider( new double[]{255,64,143} );
	ColorSlider blue = new ColorSlider( new double[]{0,0,192} );
	ColorSlider red = new ColorSlider( new double[]{193,0,0} );
	ColorSlider purple = new ColorSlider( new double[]{122,0,178} );
	ColorSlider orange = new ColorSlider( new double[]{255,134,0} );
	ColorSlider green = new ColorSlider( new double[]{0,133,50} );
	ColorSlider yellow = new ColorSlider( new double[]{246,252,15} );
	ColorSlider teal = new ColorSlider( new double[]{3,224,149} );
	ColorSlider bronze = new ColorSlider( new double[]{152,123,46} );
	ColorSlider silver = new ColorSlider( new double[]{193,192,192} );
	ColorSlider gold = new ColorSlider( new double[]{205,191,44} );
	ColorSlider lime = new ColorSlider( new double[]{126,193,33} );
	ColorSlider brown = new ColorSlider( new double[]{131,103,71} );
	ColorSlider oxylBlue0FF = new ColorSlider( new double[]{0,255,255} );

	public double[] rgb = {0,0,0};// = {0,0,0};
	public double[] argb = {0,0,0,1};// = {0,0,0};
	public Color fxColor;
	public double colorBeingChecked = 0, opacityBeingChecked = 1, rainbowInterval = 1, rainbowEndsEachLengthOfExtrema = 1, rainbowLengthWOextrema = 1, rainbowAdjustedColorInterval = 1;//, ColorToBeChecked = 0;
	//ColorValueFit colorValueFit = new ColorValueFit(0.);
	Boolean tooSimilar = false;


	public RainbowSoftColor()//1st Square DiagnosticsClass.java
	{
		rgb = new double[]{0,0,0};
		argb = new double[]{0,0,0,1};
		color = new ColorSlider( rgb );
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
	}
	public RainbowSoftColor( Color FXColor )//2nd Square DiagnosticsClass.java
	{
		fxColor = FXColor;
		rgb = new double[] { FXColor.getRed() * 255, FXColor.getGreen() * 255, FXColor.getBlue() * 255 };
		argb = new double[] { FXColor.getRed() * 255, FXColor.getGreen() * 255, FXColor.getBlue() * 255, FXColor.getOpacity() };
		color = new ColorSlider( rgb );
		colorTransparency = new TransparencySlider( argb );
	}
	public RainbowSoftColor( double[] ARGB )//3rd Square DiagnosticsClass.java
	{
		argb = ARGB;
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(argb[z]);
			argb[z] = ColorValueFitter(argb[z]);
		}
		if ( argb.length == 3 )
			argb = new double[] { argb[0], argb[1], argb[2], 1 };
		else
			argb[3] = OpacityValueFitter(argb[3]);
		color = new ColorSlider( rgb );
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
	}
	public Color RainbowSoftColorRainbowFunction(double RainbowLength, double CoreVariable)//4th Square DiagnosticsClass.java
	{
		rainbowInterval = RainbowLength / 6;
		if ( CoreVariable < 0 )
			color.set( red.ToFXColor() );
		else if ( CoreVariable < rainbowInterval)
			color.ColorSliderFunction(rainbowInterval, CoreVariable, red.ToFXColor(), orange.ToFXColor());
		else if ( CoreVariable < 2 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval, orange.ToFXColor(), yellow.ToFXColor());
		else if ( CoreVariable < 3 * rainbowInterval )		
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, yellow.ToFXColor(), green.ToFXColor());
		else if ( CoreVariable < 4 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, green.ToFXColor(), teal.ToFXColor());
		else if ( CoreVariable < 5 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, teal.ToFXColor(), blue.ToFXColor());
		else if ( CoreVariable <= RainbowLength )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, blue.ToFXColor(), purple.ToFXColor());
		else
			color.set( purple.ToFXColor() );
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(color.rgb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftColorRainbowFunctionReverse(double RainbowLength, double CoreVariable)//7th Square DiagnosticsClass.java
	{
		rainbowInterval = RainbowLength / 6;
		if ( CoreVariable < 0 )
			color.set( purple.ToFXColor() );
		else if ( CoreVariable < rainbowInterval)
			color.ColorSliderFunction(rainbowInterval, CoreVariable, purple.ToFXColor(), blue.ToFXColor());
		else if ( CoreVariable < 2 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval, blue.ToFXColor(), teal.ToFXColor());
		else if ( CoreVariable < 3 * rainbowInterval )		
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, teal.ToFXColor(), pink.ToFXColor());
		else if ( CoreVariable < 4 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, pink.ToFXColor(), yellow.ToFXColor());
		else if ( CoreVariable < 5 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, yellow.ToFXColor(), orange.ToFXColor());
		else if ( CoreVariable <= RainbowLength )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, orange.ToFXColor(), red.ToFXColor());
		else
			color.set( red.ToFXColor() );
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(color.rgb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftColorFunction(double SliderInterval, double Loc, Color ColorBefore, Color ColorAfter)//With -Loc, Loc>SliderInterval Fix Not Found In Basil Slider Classes //5th Square DiagnosticsClass.java
	{
		if ( Loc < 0 )
		{
			rgb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorBefore.getRed()) );
			rgb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorBefore.getGreen()) );
			rgb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorBefore.getBlue()) );
		}
		else
			if ( Loc > SliderInterval )
			{
				rgb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed()) );
				rgb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen()) );
				rgb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue()) );
			}
			else
			{
				rgb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Loc/SliderInterval - ToTwoFiveFivergb(ColorAfter.getRed()) * ( SliderInterval - Loc )/SliderInterval );
				rgb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Loc/SliderInterval - ToTwoFiveFivergb(ColorAfter.getGreen()) * ( SliderInterval - Loc )/SliderInterval );
				rgb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Loc/SliderInterval - ToTwoFiveFivergb(ColorAfter.getBlue()) * ( SliderInterval - Loc )/SliderInterval );
			}
		for (int z = 0; z <= 2; z++)
			argb[z] = ColorValueFitter( rgb[z] );
		argb[3] = 1;
		color = new ColorSlider( rgb );
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftColorFunction(double SliderInterval, double Loc, double BrightnessMultiplyer, int Gradations, Color ColorBefore, Color ColorAfter, boolean Adjusted, double OpacityBefore, double OpacityAfter)//With -Loc, Loc>SliderInterval Fix And All Accouchraments //6th Square DiagnosticsClass.java
	{
		if ( Loc < 0 )
		{
			rgb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorBefore.getRed()) );
			rgb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorBefore.getGreen()) );
			rgb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorBefore.getBlue()) );
			argb[3] = OpacityBefore;
		}
		else
			if ( Loc > SliderInterval )
			{
				rgb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed()) );
				rgb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen()) );
				rgb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue()) );
				argb[3] = OpacityAfter;
			}
			else
			{
				rgb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Loc/SliderInterval - ToTwoFiveFivergb(ColorAfter.getRed()) * ( SliderInterval - Loc )/SliderInterval );
				rgb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Loc/SliderInterval - ToTwoFiveFivergb(ColorAfter.getGreen()) * ( SliderInterval - Loc )/SliderInterval );
				rgb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Loc/SliderInterval - ToTwoFiveFivergb(ColorAfter.getBlue()) * ( SliderInterval - Loc )/SliderInterval );
				argb[3] = OpacityValueFitter( OpacityAfter + OpacityBefore - OpacityBefore * Loc/SliderInterval - OpacityAfter * ( SliderInterval - Loc )/SliderInterval );
			}
		for (int z = 0; z <= 2; z++)
			argb[z] = ColorValueFitter( rgb[z] );
		color = new ColorSlider( rgb );
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	/*public Color RainbowSoftColorRainbowFunction(double RainbowLength, double CoreVariable, double BrightnessMultiplyer)
	{
		if ( CoreVariable <= rainbowInterval)
			color.ColorSliderFunction(rainbowInterval, CoreVariable, red, orange);
		else if ( CoreVariable <= 2 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval, orange, yellow);
		else if ( CoreVariable <= 3 * rainbowInterval )		
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, yellow, green);
		else if ( CoreVariable <= 4 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, green, teal);
		else if ( CoreVariable <= 5 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, teal, blue);
		else
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, blue, purple);
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				rgb[z] = rgb[z] * BrightnessMultiplyer;
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = (255 - rgb[z]) / BrightnessMultiplyer + rgb[z];
			}
		//fxColor = Color.rgb( Math.abs( (int)rgb[0] ), Math.abs( (int)rgb[1] ), Math.abs( (int)rgb[2] ) );
		rgb = color.rgb;
		fxColor = color.ToFXColor();
		return new RainbowSoftColor( color.rgb );
	}//*/
	public Color RainbowSoftCustomColorFunction(double RainbowLength, double CoreVariable, double[][] RGBcolorArray)//8th Square DiagnosticsClass.java
	{
		rainbowInterval = RainbowLength / ( RGBcolorArray.length - 1 );
		customColors = new Color[RGBcolorArray.length];
		for (int x = 0; x < RGBcolorArray.length; x++)
			//{
			if ( RGBcolorArray[x].length < 4 )
				customColors[x] = Color.rgb( (int)RGBcolorArray[x][0], (int)RGBcolorArray[x][1], (int)RGBcolorArray[x][2], 1 );
			else
				customColors[x] = Color.rgb( (int)RGBcolorArray[x][0], (int)RGBcolorArray[x][1], (int)RGBcolorArray[x][2], RGBcolorArray[x][3] );
		/*tempColor = new ColorSlider( RGBcolorArray[x] );
			tempColor.set( RGBcolorArray[x] );
			customColors[x] = tempColor;
		//}// */
		if ( CoreVariable < 0 )
			color.set( customColors[0] );
		else
			if ( CoreVariable < rainbowInterval * ( customColors.length - 1 ) )
				for (int x = 0; x <= customColors.length - 2; x++)
				{
					if ( CoreVariable >= rainbowInterval * x && CoreVariable < rainbowInterval * ( x + 1 ) )
					{
						color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval * x, customColors[x], customColors[x + 1]);
						break;
					}
				}
			else
				color.set( customColors[customColors.length - 1] );
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(color.rgb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftCustomColorFunction(double RainbowLength, double CoreVariable, Color[] FXcolorArray)//9th Square DiagnosticsClass.java
	{
		rainbowInterval = RainbowLength / ( FXcolorArray.length - 1 );
		customColors = new Color[FXcolorArray.length];
		for (int x = 0; x < FXcolorArray.length; x++)
			//{
			customColors[x] = FXcolorArray[x];
		/*tempColor = new ColorSlider( FXcolorArray[x] );
			tempColor.set( FXcolorArray[x] );
			customColors[x] = tempColor;
		//}// */
		if ( CoreVariable < 0 )
			color.set( customColors[0] );
		else
			if ( CoreVariable < rainbowInterval * ( customColors.length - 1 ) )
				for (int x = 0; x <= customColors.length - 2; x++)
				{
					if ( CoreVariable >= rainbowInterval * x && CoreVariable < rainbowInterval * ( x + 1 ) )
					{
						color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval * x, customColors[x], customColors[x + 1]);
						break;
					}
				}
			else
				color.set( customColors[customColors.length - 1] );
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(color.rgb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	/*public Color RainbowSoftColorRainbowFunctionReverse(double RainbowLength, double CoreVariable, double BrightnessMultiplyer)
	{
		if ( CoreVariable <= ( rainbowInterval / ( 2 + Gradations) ) )
			color.set( purple.ToFXColor() );
		else if ( CoreVariable <= rainbowInterval)
			color.ColorSliderFunction(rainbowInterval, CoreVariable, purple, blue, Gradations);
		else if ( CoreVariable <= ( 2 * rainbowInterval) )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval, blue, teal, Gradations);
		else if ( CoreVariable <= ( 3 * rainbowInterval) )		
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, teal, pink, Gradations);
		else if ( CoreVariable <= ( 4 * rainbowInterval) )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, pink, yellow, Gradations);
		else if ( CoreVariable <= ( 5 * rainbowInterval) )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, yellow, orange, Gradations);
		else if ( CoreVariable <= RainbowLength - rainbowInterval / ( 2 + Gradations) )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, orange, red, Gradations);
		else
			color.ColorSliderFunction(RainbowLength, CoreVariable, red, red);
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				rgb[z] = rgb[z] * BrightnessMultiplyer;
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = (255 - rgb[z]) / BrightnessMultiplyer + rgb[z];
			}
		//fxColor = Color.rgb( Math.abs( (int)rgb[0] ), Math.abs( (int)rgb[1] ), Math.abs( (int)rgb[2] ) );
		rgb = color.rgb;
		fxColor = color.ToFXColor();
	}//*/
	/*public Color RainbowSoftColorRainbowFunctionUnAdjustedGradations(double RainbowLength, double CoreVariable, int Gradations)
	{
		if ( CoreVariable <= ( rainbowInterval / ( 2 + Gradations) ) )
			color.set( red.ToFXColor() );
		else if ( CoreVariable <= rainbowInterval)
			color.ColorSliderFunction(rainbowInterval, CoreVariable, red, orange, Gradations);
		else if ( CoreVariable <= 2 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval, orange, yellow, Gradations);
		else if ( CoreVariable <= 3 * rainbowInterval )		
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, yellow, green, Gradations);
		else if ( CoreVariable <= 4 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, green, teal, Gradations);
		else if ( CoreVariable <= 5 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, teal, blue, Gradations);
		else if ( CoreVariable <= RainbowLength - rainbowInterval / ( 2 + Gradations) )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, blue, purple, Gradations);
		else
			color.set( purple.ToFXColor() );
		rgb = color.rgb;
		fxColor = color.ToFXColor();
	}*/
	public Color RainbowSoftColorRainbowFunctionUnAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations)//10th Square DiagnosticsClass.java
	{
		rainbowInterval = RainbowLength / 6;
		if ( CoreVariable < 0 )
			color.set( red.ToFXColor() );
		else if ( CoreVariable < rainbowInterval)
			color.ColorSliderFunction(rainbowInterval, CoreVariable, red.ToFXColor(), orange.ToFXColor(), Gradations);
		else if ( CoreVariable < 2 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval, orange.ToFXColor(), yellow.ToFXColor(), Gradations);
		else if ( CoreVariable < 3 * rainbowInterval )		
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, yellow.ToFXColor(), green.ToFXColor(), Gradations);
		else if ( CoreVariable < 4 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, green.ToFXColor(), teal.ToFXColor(), Gradations);
		else if ( CoreVariable < 5 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, teal.ToFXColor(), blue.ToFXColor(), Gradations);
		else if ( CoreVariable <= RainbowLength )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, blue.ToFXColor(), purple.ToFXColor(), Gradations);
		else
			color.set( purple.ToFXColor() );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = ColorValueFitter( ( color.rgb[z] * BrightnessMultiplyer ) );
				argb[z] = rgb[z];
			}
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] =  (int)( rgb[z] + ( rgb[z]  + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( rgb[z] > 255 )
					rgb[z] = 255;
				rgb[z] = ColorValueFitter(rgb[z]);
				argb[z] = rgb[z];
			}
		//color.rgb[z] = (255 - color.rgb[z]) / BrightnessMultiplyer + color.rgb[z];
		//fxColor = Color.rgb( Math.abs( (int)rgb[0] ), Math.abs( (int)rgb[1] ), Math.abs( (int)rgb[2] ) );
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	/*public Color RainbowSoftColorRainbowFunctionReverseUnAdjustedGradations(double RainbowLength, double CoreVariable, int Gradations)
	{
		if ( CoreVariable <= ( rainbowInterval / ( 2 + Gradations) ) )
			color.set( purple.ToFXColor() );
		else if ( CoreVariable <= rainbowInterval)
			color.ColorSliderFunction(rainbowInterval, CoreVariable, purple, blue, Gradations);
		else if ( CoreVariable <= ( 2 * rainbowInterval) )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval, blue, teal, Gradations);
		else if ( CoreVariable <= ( 3 * rainbowInterval) )		
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, teal, pink, Gradations);
		else if ( CoreVariable <= ( 4 * rainbowInterval) )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, pink, yellow, Gradations);
		else if ( CoreVariable <= ( 5 * rainbowInterval) )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, yellow, orange, Gradations);
		else if ( CoreVariable <= RainbowLength - rainbowInterval / ( 2 + Gradations) )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, orange, red, Gradations);
		else
			color.set( red.ToFXColor() );
		rgb = color.rgb;
		fxColor = color.ToFXColor();
		return new RainbowSoftColor( rgb );
	}//*/
	public Color RainbowSoftColorRainbowFunctionReverseUnAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations)//11th Square DiagnosticsClass.java
	{
		rainbowInterval = RainbowLength / 6;
		if ( CoreVariable < 0 )
			color.set( purple.ToFXColor() );
		else if ( CoreVariable < rainbowInterval)
			color.ColorSliderFunction(rainbowInterval, CoreVariable, purple.ToFXColor(), blue.ToFXColor());
		else if ( CoreVariable < 2 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval, blue.ToFXColor(), teal.ToFXColor());
		else if ( CoreVariable < 3 * rainbowInterval )		
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, teal.ToFXColor(), pink.ToFXColor());
		else if ( CoreVariable < 4 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, pink.ToFXColor(), yellow.ToFXColor());
		else if ( CoreVariable < 5 * rainbowInterval )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, yellow.ToFXColor(), orange.ToFXColor());
		else if ( CoreVariable <= RainbowLength )
			color.ColorSliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, orange.ToFXColor(), red.ToFXColor());
		else
			color.set( red.ToFXColor() );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = ColorValueFitter( ( color.rgb[z] * BrightnessMultiplyer ) );
				argb[z] = rgb[z];
			}
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] =  (int)( rgb[z] + ( rgb[z]  + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( rgb[z] > 255 )
					rgb[z] = 255;
				rgb[z] = ColorValueFitter(rgb[z]);
				argb[z] = rgb[z];
			}
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftColorRainbowFunctionAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations)//12th Square DiagnosticsClass.java
	{//CHANGE IN ALL
		rainbowInterval = RainbowLength / 6;
		rainbowEndsEachLengthOfExtrema = rainbowInterval / ( 2 + Gradations );
		rainbowLengthWOextrema = RainbowLength - 2 * rainbowEndsEachLengthOfExtrema;
		rainbowAdjustedColorInterval = rainbowLengthWOextrema / 6;
		if ( CoreVariable < rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowEndsEachLengthOfExtrema, 0, BrightnessMultiplyer, red.ToFXColor(), red.ToFXColor(), Gradations );
		else if ( CoreVariable < rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, red.ToFXColor(), orange.ToFXColor(), Gradations );
		else if ( CoreVariable < 2 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, orange.ToFXColor(), yellow.ToFXColor(), Gradations );
		else if ( CoreVariable < 3 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - 2 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, yellow.ToFXColor(), green.ToFXColor(), Gradations );
		else if ( CoreVariable < 4 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - 3 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, green.ToFXColor(), teal.ToFXColor(), Gradations );
		else if ( CoreVariable < 5 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - 4 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, teal.ToFXColor(), blue.ToFXColor(), Gradations );
		else if ( CoreVariable < 6 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - 5 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, blue.ToFXColor(), purple.ToFXColor(), Gradations );
		else if ( CoreVariable <= RainbowLength )
			color.ColorSliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable - 6 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, purple.ToFXColor(), purple.ToFXColor(), Gradations );
		else
			color.ColorSliderFunction( rainbowAdjustedColorInterval, RainbowLength, BrightnessMultiplyer, purple.ToFXColor(), purple.ToFXColor(), Gradations );
		//colorTransparency.TransparencySliderFunction( (double)( rainbowLength ), (double)(CoreVariable), (double)(1), (int)( Gradations ) /* ( Math.pow( 10 * xSlider / sliderInterval, 3 ) When Not Testing */, new TransparencySlider(green.rgb), new TransparencySlider(teal.rgb), (double)(1), (double)(0) );
		/*if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				color.rgb[z] = color.rgb[z] * BrightnessMultiplyer;
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = rgb[z] + ( rgb[z]  + 4 ) * ( BrightnessMultiplyer - 1 );
				if ( rgb[z] > 255 )
					rgb[z] = 255;
			}// */
		//fxColor = Color.rgb( Math.abs( (int)rgb[0] ), Math.abs( (int)rgb[1] ), Math.abs( (int)rgb[2] ) );
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(color.rgb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftColorRainbowFunctionReverseAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations)//13th Square DiagnosticsClass.java
	{//CHANGE IN ALL
		rainbowInterval = RainbowLength / 6;
		rainbowEndsEachLengthOfExtrema = rainbowInterval / ( 2 + Gradations );
		rainbowLengthWOextrema = RainbowLength - 2 * rainbowEndsEachLengthOfExtrema;
		rainbowAdjustedColorInterval = rainbowLengthWOextrema / 6;// / ( ( Gradations + 1 ) * 6 - 2 * Gradations ) ;
		if ( CoreVariable < 0)
			color.ColorSliderFunction( rainbowAdjustedColorInterval, 0, BrightnessMultiplyer, purple.ToFXColor(), purple.ToFXColor(), Gradations );
		else if ( CoreVariable < rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable, BrightnessMultiplyer, purple.ToFXColor(), purple.ToFXColor(), Gradations );
		else if ( CoreVariable < rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, purple.ToFXColor(), blue.ToFXColor(), Gradations );
		else if ( CoreVariable < 2 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, blue.ToFXColor(), teal.ToFXColor(), Gradations );
		else if ( CoreVariable < 3 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - 2 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, teal.ToFXColor(), pink.ToFXColor(), Gradations );
		else if ( CoreVariable < 4 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - 3 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, pink.ToFXColor(), yellow.ToFXColor(), Gradations );
		else if ( CoreVariable < 5 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - 4 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, yellow.ToFXColor(), orange.ToFXColor(), Gradations );
		else if ( CoreVariable < 6 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - 6 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, orange.ToFXColor(), red.ToFXColor(), Gradations );
		else if ( CoreVariable <= RainbowLength )
			color.ColorSliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable - 6 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, BrightnessMultiplyer, red.ToFXColor(), red.ToFXColor(), Gradations );
		else
			color.ColorSliderFunction( rainbowAdjustedColorInterval, RainbowLength, BrightnessMultiplyer, red.ToFXColor(), red.ToFXColor(), Gradations );
		//colorTransparency.TransparencySliderFunction( (double)( rainbowLength ), (double)(CoreVariable), (double)(1), (int)( Gradations ) /* ( Math.pow( 10 * xSlider / sliderInterval, 3 ) When Not Testing */, new TransparencySlider(green.rgb), new TransparencySlider(teal.rgb), (double)(1), (double)(0) );
		/*if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				color.rgb[z] = color.rgb[z] * BrightnessMultiplyer;
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = rgb[z] + ( rgb[z]  + 4 ) * ( BrightnessMultiplyer - 1 );
				if ( rgb[z] > 255 )
					rgb[z] = 255;
			}// */
		//fxColor = Color.rgb( Math.abs( (int)rgb[0] ), Math.abs( (int)rgb[1] ), Math.abs( (int)rgb[2] ) );
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(color.rgb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftColorRainbowTransparencyFunctionUnAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, double OpacityBefore, double OpacityAfter)//14th Square DiagnosticsClass.java
	{
		rainbowInterval = RainbowLength / 6;
		if ( CoreVariable < 0)
			colorTransparency.TransparencySliderFunction(rainbowInterval, 0, BrightnessMultiplyer, Gradations, red.ToFXColor(), red.ToFXColor(), OpacityBefore );
		else if ( CoreVariable < rainbowInterval)
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable, BrightnessMultiplyer, Gradations, red.ToFXColor(), orange.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable < 2 * rainbowInterval )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - rainbowInterval, BrightnessMultiplyer, Gradations, orange.ToFXColor(), yellow.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable < 3 * rainbowInterval )		
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, BrightnessMultiplyer, Gradations, yellow.ToFXColor(), green.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable < 4 * rainbowInterval )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, BrightnessMultiplyer, Gradations, green.ToFXColor(), teal.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable < 5 * rainbowInterval )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, BrightnessMultiplyer, Gradations, teal.ToFXColor(), blue.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable <= RainbowLength )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, BrightnessMultiplyer, Gradations, blue.ToFXColor(), purple.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else
			colorTransparency.TransparencySliderFunction(rainbowInterval, RainbowLength, BrightnessMultiplyer, Gradations, purple.ToFXColor(), purple.ToFXColor(), OpacityAfter );
		//colorTransparency.TransparencySliderFunction( (double)( rainbowLength ), (double)(CoreVariable), (double)(1), (int)( Gradations ) /* ( Math.pow( 10 * xSlider / sliderInterval, 3 ) When Not Testing */, new TransparencySlider(green.rgb), new TransparencySlider(teal.rgb), (double)(1), (double)(0) );
		/*if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				colorTransparency.argb[z] = colorTransparency.argb[z] * BrightnessMultiplyer;
		else
			for (int z = 0; z <= 2; z++)
			{
				colorTransparency.argb[z] = 255 - colorTransparency.argb[z] / BrightnessMultiplyer;
			}// */
		//fxColor = Color.rgb( Math.abs( (int)rgb[0] ), Math.abs( (int)rgb[1] ), Math.abs( (int)rgb[2] ) );

		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(colorTransparency.argb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter(colorTransparency.argb[3]);
		color = new ColorSlider ( colorTransparency.ToFXColor() );
		fxColor = colorTransparency.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftColorRainbowTransparencyFunctionReverseUnAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, double OpacityBefore, double OpacityAfter)//15th Square DiagnosticsClass.java
	{
		rainbowInterval = RainbowLength / 6;
		if ( CoreVariable < 0 )
			colorTransparency.TransparencySliderFunction(rainbowInterval, 0, BrightnessMultiplyer, Gradations, purple.ToFXColor(), purple.ToFXColor(), OpacityBefore );
		else if ( CoreVariable < rainbowInterval )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable, BrightnessMultiplyer, Gradations, purple.ToFXColor(), blue.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable < 2 * rainbowInterval )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - rainbowInterval, BrightnessMultiplyer, Gradations, blue.ToFXColor(), teal.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable < 3 * rainbowInterval )		
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - 2 * rainbowInterval, BrightnessMultiplyer, Gradations, teal.ToFXColor(), pink.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable < 4 * rainbowInterval )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - 3 * rainbowInterval, BrightnessMultiplyer, Gradations, pink.ToFXColor(), yellow.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable < 5 * rainbowInterval )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - 4 * rainbowInterval, BrightnessMultiplyer, Gradations, yellow.ToFXColor(), orange.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else if ( CoreVariable <= RainbowLength )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - 5 * rainbowInterval, BrightnessMultiplyer, Gradations, orange.ToFXColor(), red.ToFXColor(), OpacityAfter + OpacityBefore - OpacityBefore * CoreVariable / RainbowLength - OpacityAfter * ( RainbowLength - CoreVariable ) / RainbowLength );
		else
			colorTransparency.TransparencySliderFunction(rainbowInterval, RainbowLength, BrightnessMultiplyer, Gradations, red.ToFXColor(), red.ToFXColor(), OpacityAfter );
		//colorTransparency.TransparencySliderFunction( (double)( rainbowLength ), (double)(CoreVariable), (double)(1), (int)( Gradations ) /* ( Math.pow( 10 * xSlider / sliderInterval, 3 ) When Not Testing */, new TransparencySlider(green.rgb), new TransparencySlider(teal.rgb), (double)(1), (double)(0) );
		/*if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				colorTransparency.argb[z] = colorTransparency.argb[z] * BrightnessMultiplyer;
		else
			for (int z = 0; z <= 2; z++)
			{
				colorTransparency.argb[z] = 255 - colorTransparency.argb[z] / BrightnessMultiplyer;
			}// */
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(colorTransparency.argb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter(colorTransparency.argb[3]);
		color = new ColorSlider ( colorTransparency.ToFXColor() );
		fxColor = colorTransparency.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftCustomColorFunctionUnAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, double[][] RGBcolorArray)//16th Square DiagnosticsClass.java
	{
		rainbowInterval = RainbowLength / ( RGBcolorArray.length - 1 );
		customColors = new Color[RGBcolorArray.length];
		for (int x = 0; x < RGBcolorArray.length; x++)
			if ( RGBcolorArray[x].length < 4 )
				customColors[x] = Color.rgb( (int)RGBcolorArray[x][0], (int)RGBcolorArray[x][1], (int)RGBcolorArray[x][2], 1 );
			else
				customColors[x] = Color.rgb( (int)RGBcolorArray[x][0], (int)RGBcolorArray[x][1], (int)RGBcolorArray[x][2], RGBcolorArray[x][3] );
		if ( CoreVariable < 0 )
			color.set( customColors[0] );
		else
			if ( CoreVariable < rainbowInterval * ( customColors.length - 1 ) )
				for (int x = 0; x < customColors.length - 1; x++)
				{
					if ( CoreVariable >= rainbowInterval * x && CoreVariable < rainbowInterval * ( x + 1 ) )
					{
						color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval * x, customColors[x], customColors[x + 1], Gradations);
						break;
					}
				}
			else
				color.set( customColors[customColors.length - 1] );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				color.rgb[z] = ColorValueFitter( color.rgb[z] * BrightnessMultiplyer );
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = rgb[z] + ( rgb[z]  + 4 ) * ( BrightnessMultiplyer - 1 );
				if ( rgb[z] > 255 )
					rgb[z] = 255;
				rgb[z] = ColorValueFitter(color.rgb[z]);
				argb[z] = rgb[z];
			}
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftCustomColorFunctionUnAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, Color[] FXcolorArray)//17th Square DiagnosticsClass.java
	{
		//System.out.println( "Function FXcolors Brightnesses" + FXcolorArray[0].getBrightness() + FXcolorArray[1].getBrightness() + FXcolorArray[2].getBrightness() + FXcolorArray[3].getBrightness() + FXcolorArray[4].getBrightness() + FXcolorArray[5].getBrightness() );
		//System.out.println("FXcolorArray.length = " + FXcolorArray.length);
		rainbowInterval = RainbowLength / ( FXcolorArray.length - 1 );
		customColors = new Color[FXcolorArray.length];
		for (int x = 0; x < FXcolorArray.length; x++)
			customColors[x] = FXcolorArray[x];
		//System.out.println( "customColors[x] R: " + customColors[0].fxColor.getRed() + " G: " + customColors[0].fxColor.getGreen() + " B: " + customColors[0].fxColor.getBlue() +" Brightneess:" + customColors[2].fxColor.getBrightness() + customColors[3].fxColor.getBrightness() + customColors[4].fxColor.getBrightness() + customColors[5].fxColor.getBrightness() );
		if ( CoreVariable < 0 )
			color.set( customColors[0] );
		else
			if ( CoreVariable < rainbowInterval * ( customColors.length - 1 ) )
				for (int x = 0; x <= customColors.length - 2; x++)
				{
					if ( CoreVariable >= rainbowInterval * x && CoreVariable < rainbowInterval * ( x + 1 ) )
					{
						color.ColorSliderFunction(rainbowInterval, CoreVariable - rainbowInterval * x, customColors[x], customColors[x + 1], Gradations);
						break;
					}
				}
			else
				color.set( customColors[customColors.length - 1] );
		//System.out.println( "color.rgb = R: " + color.rgb[0] + " G: " + color.rgb[1] + " B: " + color.rgb[2] );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				color.rgb[z] = ColorValueFitter( color.rgb[z] * BrightnessMultiplyer );
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = rgb[z] + ( rgb[z]  + 4 ) * ( BrightnessMultiplyer - 1 );
				if ( rgb[z] > 255 )
					rgb[z] = 255;
				rgb[z] = ColorValueFitter(color.rgb[z]);
				argb[z] = rgb[z];
			}
		//System.out.println( "color.rgb = R: " + color.rgb[0] + " G: " + color.rgb[1] + " B: " + color.rgb[2] );
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftCustomColorFunctionAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, double[][] RGBcolorArray)//18th Square DiagnosticsClass.java
	{
		customColors = new Color[RGBcolorArray.length];
		for (int x = 0; x < RGBcolorArray.length; x++)
			if ( RGBcolorArray[x].length < 4 )
				customColors[x] = Color.rgb( (int)RGBcolorArray[x][0], (int)RGBcolorArray[x][1], (int)RGBcolorArray[x][2], 1 );
			else
				customColors[x] = Color.rgb( (int)RGBcolorArray[x][0], (int)RGBcolorArray[x][1], (int)RGBcolorArray[x][2], RGBcolorArray[x][3] );
		rainbowInterval = RainbowLength / ( RGBcolorArray.length - 1 );
		rainbowEndsEachLengthOfExtrema = rainbowInterval / ( 2 + Gradations );
		rainbowLengthWOextrema = RainbowLength - 2 * rainbowEndsEachLengthOfExtrema;
		rainbowAdjustedColorInterval = rainbowLengthWOextrema / ( RGBcolorArray.length - 1 );// / ( ( Gradations + 1 ) * 6 - 2 * Gradations ) ;
		if ( CoreVariable < rainbowEndsEachLengthOfExtrema )
			color.set( customColors[0] );
		else
			if ( CoreVariable < ( customColors.length - 1 ) * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			{
				for (int x = 0; x <= customColors.length - 2; x++)
				{
					if ( CoreVariable >= x * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema && CoreVariable < ( x + 1 ) * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
					{
						color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - x * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, 1, customColors[x], customColors[x + 1], Gradations );
						break;
					}
				}
			}
			else
				color.set( customColors[customColors.length - 1] );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				color.rgb[z] = (int) ( color.rgb[z] * BrightnessMultiplyer );
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = (int) ( rgb[z] + ( rgb[z]  + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( rgb[z] > 255 )
					rgb[z] = 255;
			}
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(color.rgb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter( 1 );
		color = new ColorSlider ( color.ToFXColor() );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftCustomColorFunctionAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, Color[] FXcolorArray)//19th Square DiagnosticsClass.java
	{
		customColors = new Color[FXcolorArray.length];
		for (int x = 0; x < FXcolorArray.length; x++)
			customColors[x] = FXcolorArray[x];
		rainbowInterval = RainbowLength / ( FXcolorArray.length - 1 );
		rainbowEndsEachLengthOfExtrema = rainbowInterval / ( 2 + Gradations );
		rainbowLengthWOextrema = RainbowLength - 2 * rainbowEndsEachLengthOfExtrema;
		rainbowAdjustedColorInterval = rainbowLengthWOextrema / ( FXcolorArray.length - 1 );// / ( ( Gradations + 1 ) * 6 - 2 * Gradations ) ;
		if ( CoreVariable < rainbowEndsEachLengthOfExtrema )
			color.set( customColors[0] );
		else
			if ( CoreVariable < ( customColors.length - 1 ) * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			{
				for (int x = 0; x <= customColors.length - 2; x++)
				{
					if ( CoreVariable >= x * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema && CoreVariable < ( x + 1 ) * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
					{
						color.ColorSliderFunction( rainbowAdjustedColorInterval, CoreVariable - x * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, 1, customColors[x], customColors[x + 1], Gradations );
						break;
					}
				}
			}
			else
				color.set( customColors[customColors.length - 1] );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				color.rgb[z] = (int) ( color.rgb[z] * BrightnessMultiplyer );
		else
			for (int z = 0; z <= 2; z++)
			{
				rgb[z] = (int) ( rgb[z] + ( rgb[z]  + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( rgb[z] > 255 )
					rgb[z] = 255;
			}
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(color.rgb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter( 1 );
		color = new ColorSlider ( color.ToFXColor() );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftCustomColorTransparencyFunctionUnAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, double[][] ARGBcolorArray, double OpacityBefore, double OpacityAfter)//20th Square DiagnosticsClass.java
	{
		customColors = new Color[ARGBcolorArray.length];
		for (int x = 0; x < ARGBcolorArray.length; x++)
			if ( ARGBcolorArray[x].length < 4 )
				customColors[x] = Color.rgb( (int)ARGBcolorArray[x][0], (int)ARGBcolorArray[x][1], (int)ARGBcolorArray[x][2], 1 );
			else
				customColors[x] = Color.rgb( (int)ARGBcolorArray[x][0], (int)ARGBcolorArray[x][1], (int)ARGBcolorArray[x][2], ARGBcolorArray[x][3] );
		rainbowInterval = RainbowLength / ( ARGBcolorArray.length - 1 );
		if ( CoreVariable < 0 )
			colorTransparency.TransparencySliderFunction(rainbowInterval, 0, Gradations, customColors[0], customColors[0], OpacityBefore );
		else
			if ( CoreVariable < rainbowInterval * ( customColors.length - 1 ) )
				for (int x = 0; x <= customColors.length - 2; x++)
				{
					if ( CoreVariable >= rainbowInterval * x && CoreVariable < rainbowInterval * ( x + 1 ) )
					{
						colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - rainbowInterval * x, Gradations, customColors[x], customColors[x + 1], ( OpacityAfter - OpacityBefore ) * ( x * rainbowInterval ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( ( x + 1 ) * rainbowInterval ) / RainbowLength + OpacityBefore );
						break;
					}
				}
			else
				colorTransparency.TransparencySliderFunction(rainbowInterval, RainbowLength, Gradations, customColors[customColors.length - 1], customColors[customColors.length - 1], OpacityAfter );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				colorTransparency.argb[z] = colorTransparency.argb[z] * BrightnessMultiplyer;
		else
			for (int z = 0; z <= 2; z++)
			{
				colorTransparency.argb[z] = colorTransparency.argb[z] + ( colorTransparency.argb[z] + 4 ) * ( BrightnessMultiplyer - 1 );
				if ( colorTransparency.argb[z] > 255 )
					colorTransparency.argb[z] = 255;
			}
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(colorTransparency.argb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter(colorTransparency.argb[3]);
		color = new ColorSlider ( colorTransparency.ToFXColor() );
		fxColor = colorTransparency.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftCustomColorTransparencyFunctionUnAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, Color[] FXcolorArray, double OpacityBefore, double OpacityAfter)//21st Square DiagnosticsClass.java
	{
		customColors = new Color[FXcolorArray.length];
		for (int x = 0; x < FXcolorArray.length; x++)
			customColors[x] = FXcolorArray[x];
		rainbowInterval = RainbowLength / ( FXcolorArray.length - 1 );
		if ( CoreVariable < 0 )
			colorTransparency.TransparencySliderFunction(rainbowInterval, 0, Gradations, customColors[0], customColors[0], OpacityBefore );
		else
			if ( CoreVariable < rainbowInterval * ( customColors.length - 1 ) )
				for (int x = 0; x <= customColors.length - 2; x++)
				{
					if ( CoreVariable >= rainbowInterval * x && CoreVariable < rainbowInterval * ( x + 1 ) )
					{
						colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable - rainbowInterval * x, Gradations, customColors[x], customColors[x + 1], ( OpacityAfter - OpacityBefore ) * ( x * rainbowInterval ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( ( x + 1 ) * rainbowInterval ) / RainbowLength + OpacityBefore );
						break;
					}
				}
			else
				colorTransparency.TransparencySliderFunction( rainbowInterval, RainbowLength, Gradations, customColors[customColors.length - 1], customColors[customColors.length - 1], OpacityAfter );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				colorTransparency.argb[z] = (int) ( colorTransparency.argb[z] * BrightnessMultiplyer );
		else
			for (int z = 0; z <= 2; z++)
			{
				colorTransparency.argb[z] = (int) ( colorTransparency.argb[z] + ( colorTransparency.argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( colorTransparency.argb[z] > 255 )
					colorTransparency.argb[z] = 255;
			}
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(colorTransparency.argb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter(colorTransparency.argb[3]);
		color = new ColorSlider ( colorTransparency.ToFXColor() );
		fxColor = colorTransparency.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftColorRainbowTransparencyFunctionAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, double OpacityBefore, double OpacityAfter)//22nd Square DiagnosticsClass.java
	{//CHANGE IN ALL
		rainbowInterval = RainbowLength / 6;
		rainbowEndsEachLengthOfExtrema = rainbowInterval / ( 2 + Gradations );
		rainbowLengthWOextrema = RainbowLength - 2 * rainbowEndsEachLengthOfExtrema;
		rainbowAdjustedColorInterval = rainbowLengthWOextrema / 6;
		if ( CoreVariable < 0 )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, 0, Gradations, red.ToFXColor(), red.ToFXColor(), OpacityBefore );
		else if ( CoreVariable < rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable, Gradations, red.ToFXColor(), red.ToFXColor(), OpacityBefore, ( OpacityAfter - OpacityBefore ) * rainbowEndsEachLengthOfExtrema / RainbowLength + OpacityBefore );
		else if ( CoreVariable < rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - rainbowEndsEachLengthOfExtrema, Gradations, red.ToFXColor(), orange.ToFXColor(), ( OpacityAfter - OpacityBefore ) * rainbowEndsEachLengthOfExtrema / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 2 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, orange.ToFXColor(), yellow.ToFXColor(), ( OpacityAfter - OpacityBefore ) * ( rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )/ RainbowLength + OpacityBefore , ( OpacityAfter - OpacityBefore ) * ( 2 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 3 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - 2 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, yellow.ToFXColor(), green.ToFXColor(), ( OpacityAfter - OpacityBefore ) * ( 2 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( 3 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 4 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - 3 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, green.ToFXColor(), teal.ToFXColor(),  ( OpacityAfter - OpacityBefore ) * ( 3 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( 4 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 5 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - 4 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, teal.ToFXColor(), blue.ToFXColor(),  ( OpacityAfter - OpacityBefore ) * ( 4 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( 5 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 6 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - 5 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, blue.ToFXColor(), purple.ToFXColor(), ( OpacityAfter - OpacityBefore ) * ( 5 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( 6 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable <= RainbowLength )
			colorTransparency.TransparencySliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable - 6 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, purple.ToFXColor(), purple.ToFXColor(), ( OpacityAfter - OpacityBefore ) * ( 6 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, OpacityAfter );
		else
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, RainbowLength, Gradations, purple.ToFXColor(), purple.ToFXColor(), OpacityAfter );
		//colorTransparency.TransparencySliderFunction( (double)( rainbowLength ), (double)(CoreVariable), (double)(1), (int)( Gradations ) /* ( Math.pow( 10 * xSlider / sliderInterval, 3 ) When Not Testing */, new TransparencySlider(green.rgb), new TransparencySlider(teal.rgb), (double)(1), (double)(0) );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				colorTransparency.argb[z] = (int) ( colorTransparency.argb[z] * BrightnessMultiplyer );
		else
			for (int z = 0; z <= 2; z++)
			{
				colorTransparency.argb[z] = (int) ( colorTransparency.argb[z] + ( colorTransparency.argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( colorTransparency.argb[z] > 255 )
					colorTransparency.argb[z] = 255;
			}
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(colorTransparency.argb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter(colorTransparency.argb[3]);
		color = new ColorSlider ( colorTransparency.ToFXColor() );
		fxColor = colorTransparency.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftColorRainbowTransparencyFunctionReverseAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, double OpacityBefore, double OpacityAfter)//23rd Square DiagnosticsClass.java
	{//CHANGE IN ALL
		rainbowInterval = RainbowLength / 6;
		rainbowEndsEachLengthOfExtrema = rainbowInterval / ( 2 + Gradations );
		rainbowLengthWOextrema = RainbowLength - 2 * rainbowEndsEachLengthOfExtrema;
		rainbowAdjustedColorInterval = rainbowLengthWOextrema / 6;// / ( ( Gradations + 1 ) * 6 - 2 * Gradations ) ;
		if ( CoreVariable < 0 )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, 0, Gradations, purple.ToFXColor(), purple.ToFXColor(), OpacityBefore );
		else if ( CoreVariable < rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable, Gradations, purple.ToFXColor(), purple.ToFXColor(), OpacityBefore, ( OpacityAfter - OpacityBefore ) * rainbowEndsEachLengthOfExtrema / RainbowLength + OpacityBefore );
		else if ( CoreVariable < rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - rainbowEndsEachLengthOfExtrema, Gradations, purple.ToFXColor(), blue.ToFXColor(), ( OpacityAfter - OpacityBefore ) * rainbowEndsEachLengthOfExtrema / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 2 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, blue.ToFXColor(), teal.ToFXColor(), ( OpacityAfter - OpacityBefore ) * ( rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore , ( OpacityAfter - OpacityBefore ) * ( 2 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 3 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - 2 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, teal.ToFXColor(), pink.ToFXColor(), ( OpacityAfter - OpacityBefore ) * ( 2 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( 3 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 4 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - 3 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, pink.ToFXColor(), yellow.ToFXColor(),  ( OpacityAfter - OpacityBefore ) * ( 3 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( 4 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 5 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - 4 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, yellow.ToFXColor(), orange.ToFXColor(),  ( OpacityAfter - OpacityBefore ) * ( 4 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( 5 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable < 6 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - 5 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, orange.ToFXColor(), red.ToFXColor(), ( OpacityAfter - OpacityBefore ) * ( 5 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( 6 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
		else if ( CoreVariable <= RainbowLength )
			colorTransparency.TransparencySliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable - 6 * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, red.ToFXColor(), red.ToFXColor(), ( OpacityAfter - OpacityBefore ) * ( 6 * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, OpacityAfter );
		else
			colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, RainbowLength, Gradations, red.ToFXColor(), red.ToFXColor(), OpacityAfter );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				colorTransparency.argb[z] = colorTransparency.argb[z] * BrightnessMultiplyer;
		else
			for (int z = 0; z <= 2; z++)
			{
				colorTransparency.argb[z] = colorTransparency.argb[z] + ( colorTransparency.argb[z] + 4 ) * ( BrightnessMultiplyer - 1 );
				if ( colorTransparency.argb[z] > 255 )
					colorTransparency.argb[z] = 255;
			}
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(colorTransparency.argb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter(colorTransparency.argb[3]);
		color = new ColorSlider ( colorTransparency.ToFXColor() );
		fxColor = colorTransparency.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftCustomColorTransparencyFunctionAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, double[][] ARGBcolorArray, double OpacityBefore, double OpacityAfter)//24th Square DiagnosticsClass.java
	{
		customColors = new Color[ARGBcolorArray.length];
		for (int x = 0; x < ARGBcolorArray.length; x++)
			if ( ARGBcolorArray[x].length < 4 )
				customColors[x] = Color.rgb( (int)ARGBcolorArray[x][0], (int)ARGBcolorArray[x][1], (int)ARGBcolorArray[x][2], 1 );
			else
				customColors[x] = Color.rgb( (int)ARGBcolorArray[x][0], (int)ARGBcolorArray[x][1], (int)ARGBcolorArray[x][2], ARGBcolorArray[x][3] );
		rainbowInterval = RainbowLength / ( ARGBcolorArray.length - 1 );
		rainbowEndsEachLengthOfExtrema = rainbowInterval / ( 2 + Gradations );
		rainbowLengthWOextrema = RainbowLength - 2 * rainbowEndsEachLengthOfExtrema;
		rainbowAdjustedColorInterval = rainbowLengthWOextrema / ( ARGBcolorArray.length - 1 );// / ( ( Gradations + 1 ) * 6 - 2 * Gradations ) ;
		if ( CoreVariable < 0 )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable, Gradations, customColors[0], customColors[0], OpacityBefore );
		else if ( CoreVariable < rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable, Gradations, customColors[0], customColors[0], OpacityBefore, ( OpacityAfter - OpacityBefore ) * rainbowEndsEachLengthOfExtrema / RainbowLength + OpacityBefore );
		else
			if ( CoreVariable < customColors.length * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
				for (int x = 0; x <= customColors.length - 2; x++)
				{
					if ( CoreVariable >= x * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema && CoreVariable < ( x + 1 ) * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
					{
						colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - x * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, customColors[x], customColors[x + 1], ( OpacityAfter - OpacityBefore ) * ( x * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( ( x + 1 ) * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
						break;
					}
				}
			else if ( CoreVariable <= RainbowLength )
				colorTransparency.TransparencySliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable, Gradations, customColors[customColors.length - 1], customColors[customColors.length - 1], ( OpacityAfter - OpacityBefore ) * ( RainbowLength - rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore,  OpacityAfter );
			else
				colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable, Gradations, customColors[customColors.length - 1], customColors[customColors.length - 1], OpacityAfter );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				colorTransparency.argb[z] = (int) ( colorTransparency.argb[z] * BrightnessMultiplyer );
		else
			for (int z = 0; z <= 2; z++)
			{
				colorTransparency.argb[z] = (int) ( colorTransparency.argb[z] + ( colorTransparency.argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( colorTransparency.argb[z] > 255 )
					colorTransparency.argb[z] = 255;
			}
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(colorTransparency.argb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter(colorTransparency.argb[3]);
		color = new ColorSlider ( colorTransparency.ToFXColor() );
		fxColor = colorTransparency.ToFXColor();
		return fxColor;
	}
	public Color RainbowSoftCustomColorTransparencyFunctionAdjusted(double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, Color[] FXcolorArray, double OpacityBefore, double OpacityAfter)//25th Square DiagnosticsClass.java
	{
		customColors = new Color[FXcolorArray.length];
		for (int x = 0; x < FXcolorArray.length; x++)
			customColors[x] = FXcolorArray[x];
		rainbowInterval = RainbowLength / ( FXcolorArray.length - 1 );
		rainbowEndsEachLengthOfExtrema = rainbowInterval / ( 2 + Gradations );
		rainbowLengthWOextrema = RainbowLength - 2 * rainbowEndsEachLengthOfExtrema;
		rainbowAdjustedColorInterval = rainbowLengthWOextrema / ( FXcolorArray.length - 1 );// / ( ( Gradations + 1 ) * 6 - 2 * Gradations ) ;
		if ( CoreVariable < 0 )
			colorTransparency.TransparencySliderFunction(rainbowInterval, CoreVariable, Gradations, customColors[0], customColors[0], OpacityBefore );
		else if ( CoreVariable < rainbowEndsEachLengthOfExtrema )
			colorTransparency.TransparencySliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable, Gradations, customColors[0], customColors[0], OpacityBefore, ( OpacityAfter - OpacityBefore ) * rainbowEndsEachLengthOfExtrema / RainbowLength + OpacityBefore );
		else
			if ( CoreVariable < customColors.length * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
				for (int x = 0; x <= customColors.length - 2; x++)
				{
					if ( CoreVariable >= x * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema && CoreVariable < ( x + 1 ) * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema )
					{
						colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable - x * rainbowAdjustedColorInterval - rainbowEndsEachLengthOfExtrema, Gradations, customColors[x], customColors[x + 1], ( OpacityAfter - OpacityBefore ) * ( x * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore, ( OpacityAfter - OpacityBefore ) * ( ( x + 1 ) * rainbowAdjustedColorInterval + rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore );
						break;
					}
				}
			else if ( CoreVariable <= RainbowLength )
				colorTransparency.TransparencySliderFunction( rainbowEndsEachLengthOfExtrema, CoreVariable, Gradations, customColors[customColors.length - 1], customColors[customColors.length - 1], ( OpacityAfter - OpacityBefore ) * ( RainbowLength - rainbowEndsEachLengthOfExtrema ) / RainbowLength + OpacityBefore,  OpacityAfter );
			else
				colorTransparency.TransparencySliderFunction( rainbowAdjustedColorInterval, CoreVariable, Gradations, customColors[customColors.length - 1], customColors[customColors.length - 1], OpacityAfter );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for (int z = 0; z <= 2; z++)
				colorTransparency.argb[z] = (int) ( colorTransparency.argb[z] * BrightnessMultiplyer );
		else
			for (int z = 0; z <= 2; z++)
			{
				colorTransparency.argb[z] = (int) ( colorTransparency.argb[z] + ( colorTransparency.argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( colorTransparency.argb[z] > 255 )
					colorTransparency.argb[z] = 255;
			}
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(colorTransparency.argb[z]);
			argb[z] = rgb[z];
		}
		argb[3] = OpacityValueFitter(colorTransparency.argb[3]);
		color = new ColorSlider ( colorTransparency.ToFXColor() );
		fxColor = colorTransparency.ToFXColor();
		return fxColor;
	}
	public Color ToFXColor ()//26th Square DiagnosticsClass.java
	{
		fxColor = color.ToFXColor();
		return fxColor;
	}
	public Color ToFXColor ( double[] ARGB )//27th Square DiagnosticsClass.java
	{
		argb = ARGB;
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(argb[z]);
			argb[z] = rgb[z];
		}
		if ( argb.length == 3 )
			argb = new double[] { argb[0], argb[1], argb[2], 1 };
		else
			argb[3] = OpacityValueFitter(argb[3]);
		color = new ColorSlider( rgb );
		colorTransparency = new TransparencySlider ( argb );
		fxColor = color.ToFXColor();
		return fxColor;
	}
	//tempfxColor = tempColor.rgb((int)color.rgb[0] , Math.abs( (int)color.rgb[1] ), (int)color.rgb[2]).invert();
	public Boolean ColorTooSimilarFunction(int Color1, int Color2)//28th Square DiagnosticsClass.java
	{
		tooSimilar = false;
		int color1A = (Color1 >> 24) & 0xff;
		int color1R = (Color1 >> 16) & 0xff;
		int color1G = (Color1 >> 8) & 0xff;
		int color1B = (Color1) & 0xff;
		int color2A = (Color2 >> 24) & 0xff;
		int color2R = (Color2 >> 16) & 0xff;
		int color2G = (Color2 >> 8) & 0xff;
		int color2B = (Color2) & 0xff;
		/*
		int Color1A = Color1 / 16777216;
		int Color1R = ( Color1 - Color1A * 16777216 ) / 65536;
		int Color1G = ( Color1 - Color1A * 16777216 - Color1R * 65536 ) / 256;
		int Color1B = ( Color1 - Color1A * 16777216 - Color1R * 65536 - Color1G * 256);
		int Color2A = Color2 / 16777216;
		int Color2R = ( Color2 - Color2A * 16777216 ) / 65536;
		int Color2G = ( Color2 - Color2A * 16777216 - Color2R * 65536 ) / 256;
		int Color2B = ( Color2 - Color2A * 16777216 - Color2R * 65536 - Color2G * 256);// */
		int colorDifference = Math.abs(color1A - color2A) + Math.abs(color1R - color2R) + Math.abs(color1G - color2G) + Math.abs(color1B - color2B);
		if ( colorDifference <= 164 )
			tooSimilar = true;
		else
			tooSimilar = false;
		//System.out.println("colorDifference: " + colorDifference);
		//System.out.println(tooSimilar);
		return tooSimilar;
	}
	public Boolean ColorTooSimilarFunction( Color Color1, Color Color2)//29th Square DiagnosticsClass.java
	{
		tooSimilar = false;
		int colorDifference = (int)(255 * ( Math.abs(Color1.getOpacity() - Color2.getOpacity()) + Math.abs(Color1.getRed() - Color2.getRed()) + Math.abs(Color1.getGreen() - Color2.getGreen()) + Math.abs(Color1.getBlue() - Color2.getBlue() ) ) );
		if ( colorDifference <= 164 )
			tooSimilar = true;
		else
			tooSimilar = false;
		//System.out.println("colorDifference: " + colorDifference);
		//System.out.println(tooSimilar);
		return tooSimilar;
	}
	public Boolean ColorTooSimilarFunction( int Color1, int Color2, double ColorDifference )//3rd Square DiagnosticsClass.java
	{
		tooSimilar = false;
		int color1A = (Color1 >> 24) & 0xff;
		int color1R = (Color1 >> 16) & 0xff;
		int color1G = (Color1 >> 8) & 0xff;
		int color1B = (Color1) & 0xff;
		int color2A = (Color2 >> 24) & 0xff;
		int color2R = (Color2 >> 16) & 0xff;
		int color2G = (Color2 >> 8) & 0xff;
		int color2B = (Color2) & 0xff;
		int colorDifference = Math.abs(color1A - color2A) + Math.abs(color1R - color2R) + Math.abs(color1G - color2G) + Math.abs(color1B - color2B);
		if ( colorDifference <= ColorDifference )//200 )
			tooSimilar = true;
		else
			tooSimilar = false;
		//System.out.println("colorDifference: " + colorDifference);
		//System.out.println(tooSimilar);
		return tooSimilar;
	}
	public Boolean ColorTooSimilarFunction( Color Color1, Color Color2, double ColorDifference )//4th Square DiagnosticsClass.java
	{
		tooSimilar = false;
		int colorDifference = (int)( 255 * (  Math.abs(Color1.getOpacity() - Color2.getOpacity()) + Math.abs(Color1.getRed() - Color2.getRed()) + Math.abs(Color1.getGreen() - Color2.getGreen()) + Math.abs(Color1.getBlue() - Color2.getBlue()) ) );
		if ( colorDifference <= ColorDifference )//200 )
			tooSimilar = true;
		else
			tooSimilar = false;
		//System.out.println("colorDifference: " + colorDifference);
		//System.out.println(tooSimilar);
		return tooSimilar;
	}
	public double ColorValueFitter ( double ColorToBeChecked )//30th Square DiagnosticsClass.java
	{
		colorBeingChecked = ColorToBeChecked;
		while ( colorBeingChecked < -4080 )
			colorBeingChecked = colorBeingChecked + 4080;
		while ( colorBeingChecked < 0 )
			colorBeingChecked = colorBeingChecked + 255;
		while ( colorBeingChecked > 4080 )
			colorBeingChecked = colorBeingChecked - 4080;
		while ( colorBeingChecked > 255 )
			colorBeingChecked = colorBeingChecked - 255;
		return Math.round(colorBeingChecked);
	}
	public double OpacityValueFitter ( double OpacityToBeChecked )//31st Square DiagnosticsClass.java
	{
		opacityBeingChecked = OpacityToBeChecked;
		while ( opacityBeingChecked < -16 )
			opacityBeingChecked = opacityBeingChecked + 16;
		while ( opacityBeingChecked < 0 )
			opacityBeingChecked = opacityBeingChecked + 1;
		while ( opacityBeingChecked > 16 )
			opacityBeingChecked = opacityBeingChecked - 16;
		while ( opacityBeingChecked > 1 )
			opacityBeingChecked = opacityBeingChecked - 1;
		return opacityBeingChecked;
	}

	public Object GlobalRainbowSoftSelectorFunction( double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, boolean Adjusted, double[][] ARGBcolorArray, double OpacityBefore, double OpacityAfter, boolean Reversed, boolean IsColorNum )//Separate RainbowSoftColorGlobalRainbowSoftSelector MultiComponent Diagnostic
	{
		//WORK ON ME EVENTUALLY
		System.out.println( "Use 'RainbowSoftColorRainbowFunction(double RainbowLength, double CoreVariable)' Instead Of GloabalRainbowSoftSelectorFunction! As It Will Be Faster" );
		return new RainbowSoftColor( colorTransparency.argb );
	}
	public Object GlobalRainbowSoftSelectorFunction( double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, boolean Adjusted, Color[] FXcolorArray, double OpacityBefore, double OpacityAfter, boolean Reversed, boolean IsColorNum )//Separate RainbowSoftColorGlobalRainbowSoftSelector MultiComponent Diagnostic
	{
		//WORK ON ME EVENTUALLY
		System.out.println( "Use 'RainbowSoftColorRainbowFunction(double RainbowLength, double CoreVariable)' Instead Of GloabalRainbowSoftSelectorFunction! As It Will Be Faster" );
		return new RainbowSoftColor( colorTransparency.argb );
	}
	public Object GlobalRainbowSoftSelectorFunction( double RainbowLength, double CoreVariable, double BrightnessMultiplyer, int Gradations, boolean Adjusted, double OpacityBefore, double OpacityAfter, boolean Reversed, boolean IsColorNum )//Separate RainbowSoftColorGlobalRainbowSoftSelector MultiComponent Diagnostic
	{
		//WORK ON ME EVENTUALLY
		System.out.println( "Use 'RainbowSoftColorRainbowFunction(double RainbowLength, double CoreVariable)' Instead Of GloabalRainbowSoftSelectorFunction! As It Will Be Faster" );
		return new RainbowSoftColor( colorTransparency.argb );
	}
	public double ToTwoFiveFivergb ( double ZeroToOne )
	{	return 255. * ZeroToOne;	}
	public void set(double[] ARGB) { argb = ARGB; for (int z = 0; z <= 2; z++)	{ rgb[z] = argb[z]; } fxColor = Color.rgb( (int)(ColorValueFitter(rgb[0])), (int)(ColorValueFitter(rgb[1])), (int)(ColorValueFitter(rgb[2])), OpacityValueFitter(argb[3])); color = new ColorSlider( rgb ); colorTransparency = new TransparencySlider ( argb ); }//32st Square DiagnosticsClass.java
	public void set(Color FXColor) { fxColor = FXColor; argb = new double[] { fxColor.getRed() * 255, fxColor.getGreen() * 255, fxColor.getBlue() * 255, fxColor.getOpacity() }; rgb = new double[] { FXColor.getRed() * 255, FXColor.getGreen() * 255, FXColor.getBlue() * 255 }; color = new ColorSlider( rgb ); colorTransparency = new TransparencySlider ( argb ); }//33nd Square DiagnosticsClass.java
	public Color get() { return fxColor; }//34th Square DiagnosticsClass.java
	//public Object get() { return fxColor; }
}//*/


/*public class Color(double R, double G, double B)  Color
{
	rgb[0] = R;
	rgb[1] = G;
	rgb[2] = B;
	//return rgb;
}*/
