package rainbowPackage;

//import javafx.scene.paint.Paint.*;
import javafx.scene.paint.Color;
import javafx.geometry.Rectangle2D;

public class Diagnostics
{
	public Rectangle2D bounds = new Rectangle2D( 0, 0, 1920, 1080 );
	public ColorTooSimilar colorTooSimilar = new ColorTooSimilar(false);
	public double[] rgb = {0,0,0};// = {0,0,0};
	public double[] argb = {0,0,0,1};// = {0,0,0};
	public Color fxColor;
	ColorSlider black = new ColorSlider( new double[]{0,0,0} );
	ColorSlider white = new ColorSlider( new double[]{255,255,255} );
	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 neongreen = new ColorSlider( new double[]{0,255,0} );
	ColorSlider oxylblue0FF = new ColorSlider( new double[]{0,255,255} );
	int oxylblue0FFNum = (int)(255 * 16777216) + (int)(0 * 65536) + (int)(255 * 256) + 255;
	TransparencySlider blackT = new TransparencySlider( new double[]{0,0,0} );
	TransparencySlider whiteT = new TransparencySlider( new double[]{255,255,255} );
	TransparencySlider skyblueT = new TransparencySlider( new double[]{134,206,249} );
	TransparencySlider oxylblueT = new TransparencySlider( new double[]{0,255,255} );
	TransparencySlider pinkT = new TransparencySlider( new double[]{255,64,143} );
	TransparencySlider blueT = new TransparencySlider( new double[]{0,0,192} );
	TransparencySlider redT = new TransparencySlider( new double[]{193,0,0} );
	TransparencySlider purpleT = new TransparencySlider( new double[]{122,0,178} );
	TransparencySlider orangeT = new TransparencySlider( new double[]{255,134,0} );
	TransparencySlider greenT = new TransparencySlider( new double[]{0,133,50} );
	TransparencySlider yellowT = new TransparencySlider( new double[]{246,252,15} );
	TransparencySlider tealT = new TransparencySlider( new double[]{3,224,149} );
	TransparencySlider bronzeT = new TransparencySlider( new double[]{152,123,46} );
	TransparencySlider silverT = new TransparencySlider( new double[]{193,192,192} );
	TransparencySlider goldT = new TransparencySlider( new double[]{205,191,44} );
	TransparencySlider limeT = new TransparencySlider( new double[]{126,193,33} );
	TransparencySlider brownT = new TransparencySlider( new double[]{131,103,71} );
	TransparencySlider neongreenT = new TransparencySlider( new double[]{0,255,0} );
	TransparencySlider oxylblue0FFT = new TransparencySlider( new double[]{0,255,255} );

	Color[] imperialFXcolors = new Color[] {green.ToFXColor(), blue.ToFXColor(), purple.ToFXColor(), blue.ToFXColor(), green.ToFXColor()};
	double[][] imperialColorsNum = {green.rgb, blue.rgb, purple.rgb, purple.rgb, blue.rgb, green.rgb};
	Color[] imperialFXcolorsReverse = new Color[] {red.ToFXColor(), orange.ToFXColor(), gold.ToFXColor(), orange.ToFXColor(), red.ToFXColor()};
	double[][] imperialColorsReverseNum = {red.rgb, orange.rgb, gold.rgb, gold.rgb, orange.rgb, red.rgb};
	Color[] doubleBlack = new Color[] { black.ToFXColor(), black.ToFXColor() };

	ColorSlider color = black;
	TransparencySlider colorTransparency = new TransparencySlider( new double[]{0,0,0,1} );
	RainbowSoftColor rainbowSoftColor = new RainbowSoftColor ( new double[]{0,0,0,1} );
	int xRectangleNum = 0, yRectangleNum = 0;
	public double colorBeingChecked = 0, opacityBeingChecked = 1, xSlid = 0;

	public Diagnostics ( Rectangle2D Bounds )
	{
		bounds = Bounds;
	}
	public Color ToFXColor ()//8th Square BasicDiagnosticsClass.java
	{
		fxColor = fxColor.rgb( (int)(ColorValueFitter(rgb[0])), (int)(ColorValueFitter(rgb[1])), (int)(ColorValueFitter(rgb[2])) );
		return fxColor;
	}

	public Object ColorTooSimilar( double x, double y, double xSlider )//ADD BOUNDS!!!!!!!!!!!!!!
	{
		int xRectangleQuantity = 3, yRectangleQuantity = 2;
		
		for ( xRectangleNum = 0; xRectangleNum < xRectangleQuantity; xRectangleNum++ )
			if ( x >= bounds.getMinX() + bounds.getWidth() * xRectangleNum / xRectangleQuantity && x <= bounds.getMinX() + bounds.getWidth() * ( xRectangleNum + 1 ) / xRectangleQuantity )
				break;
		for ( yRectangleNum = 0; yRectangleNum < yRectangleQuantity; yRectangleNum++ )
			if ( y >= bounds.getMinY() + bounds.getHeight() * yRectangleNum / yRectangleQuantity && y <= bounds.getMinY() + bounds.getHeight() * ( yRectangleNum + 1 ) / yRectangleQuantity )
				break;
		xSlid = x - bounds.getMinX() - xRectangleNum * bounds.getWidth() - xSlider / xRectangleQuantity;
		while ( xSlid < 0 )
			xSlid = xSlid + bounds.getWidth() / xRectangleQuantity;
		while ( xSlid > bounds.getWidth() / xRectangleQuantity )
			xSlid = xSlid - bounds.getWidth() / xRectangleQuantity;
		
		color.ColorSliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, purple, oxylblue0FF );
		switch ( yRectangleNum )
		{
		case 0:
			switch ( xRectangleNum )
			{
			case 0:
				colorTooSimilar = new ColorTooSimilar ();
				if ( colorTooSimilar.tooSimilar )
					color = neongreen;
					//color = new ColorSlider(color.fxColor.invert());
				break;
			case 1:
				colorTooSimilar = new ColorTooSimilar ( true );
				if ( colorTooSimilar.tooSimilar )
					color = neongreen;
					//color = new ColorSlider(color.fxColor.invert());
				break;
			case 2:
				int tempColorNum = (int)((int)( 255 * 16777216) + (int)(color.ToFXColor().getRed() * 255 * 65536) + (int)(color.ToFXColor().getGreen() * 255 * 256) + color.ToFXColor().getBlue() * 255);
				if ( colorTooSimilar.ColorTooSimilarFunction( tempColorNum, oxylblue0FFNum ) )
					color = neongreen;
					//color = new ColorSlider(color.fxColor.invert());
				break;
			}
			break;
		case 1:
			switch ( xRectangleNum )
			{
			case 0:
				color.ColorSliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, purple, oxylblue0FF );
				if ( colorTooSimilar.ColorTooSimilarFunction( color.ToFXColor(), oxylblue0FF.ToFXColor() ) )
					color = neongreen;
					//color = new ColorSlider(color.fxColor.invert());
				break;
			case 1:
				colorTooSimilar.set(true);
				if ( colorTooSimilar.tooSimilar )
					color = neongreen;
					//color = new ColorSlider(color.fxColor.invert());
				break;
			case 2:
				if ( (boolean) colorTooSimilar.get() )
					color = neongreen;
					//color = new ColorSlider(color.fxColor.invert());
				break;
			}
			break;
		}
		return color;
	}

	public Object ColorSlider( double x, double y, double xSlider, double BrightnessMultiplyer, int Gradations )
	{
		int xRectangleQuantity = 3, yRectangleQuantity = 5;
		
		for ( xRectangleNum = 0; xRectangleNum < xRectangleQuantity; xRectangleNum++ )
			if ( x >= bounds.getMinX() + bounds.getWidth() * xRectangleNum / xRectangleQuantity && x <= bounds.getMinX() + bounds.getWidth() * ( xRectangleNum + 1 ) / xRectangleQuantity )
				break;
		for ( yRectangleNum = 0; yRectangleNum < yRectangleQuantity; yRectangleNum++ )
			if ( y >= bounds.getMinY() + bounds.getHeight() * yRectangleNum / yRectangleQuantity && y <= bounds.getMinY() + bounds.getHeight() * ( yRectangleNum + 1 ) / yRectangleQuantity )
				break;
		xSlid = x - bounds.getMinX() - xRectangleNum * bounds.getWidth() - xSlider / xRectangleQuantity;
		while ( xSlid < 0 )
			xSlid = xSlid + bounds.getWidth() / xRectangleQuantity;
		while ( xSlid > bounds.getWidth() / xRectangleQuantity )
			xSlid = xSlid - bounds.getWidth() / xRectangleQuantity;
		
		switch ( yRectangleNum )
		{
		case 0:
			switch ( xRectangleNum )
			{
			case 0:
				color = new ColorSlider();
				break;
			case 1:
				color = new ColorSlider( white.fxColor );
				break;
			case 2:
				color = new ColorSlider( green.rgb );
				break;
			}
			break;
		case 1:
			switch ( xRectangleNum )
			{
			case 0:
				color.ColorSliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, green, purple );
				break;
			case 1:
				color.ColorSliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, blue, green );
				break;
			case 2:
				color.ColorSliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, purple, green, Gradations );
				break;
			}
			break;
		case 2:
			switch ( xRectangleNum )
			{
			case 0:
				color.ColorSliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, purple, green, Gradations );
				break;
			case 1:
				color = new ColorSlider ( color.ToFXColor() );
				break;
			case 2:
				color = new ColorSlider ( color.ToFXColor( pink.rgb ) );
				break;
			}
			break;
		case 3:
			switch ( xRectangleNum )
			{
			case 0:
				color.ColorSliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, blue, oxylblue0FF );
				int tempColorNum = (int)((int)( 255 * 16777216) + (int)(color.ToFXColor().getRed() * 255 * 65536) + (int)(color.ToFXColor().getGreen() * 255 * 256) + color.ToFXColor().getBlue() * 255);
				if ( color.ColorTooSimilarFunction( tempColorNum, oxylblue0FFNum ) )
					color = neongreen;
				break;
			case 1:
				color.ColorSliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, purple, oxylblue0FF );
				if ( color.ColorTooSimilarFunction( color, oxylblue0FF ) )
					color = neongreen;
				break;
			case 2:
				if ( 0 <= color.ColorValueFitter(5000) && color.ColorValueFitter(5000) <= 255  && 0 <= color.ColorValueFitter(-5000) && color.ColorValueFitter(-5000) <= 255 )
					color = white;
				else
					color = black;
				break;
			}
			break;
		case 4:
			switch ( xRectangleNum )
			{
			case 0:
				color.set( fxColor.AQUAMARINE );
				break;
			case 1:
				color.set( new double[]{255,134,0} );
				break;
			case 2:
				color = new ColorSlider ( (double[]) gold.get() );
				break;
			}
			break;
		}
		rgb = color.rgb;
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(color.rgb[z]);
			argb[z] = ColorValueFitter(rgb[z]);
		}
		argb[3] = 1;
		colorTransparency = new TransparencySlider( argb );
		fxColor = color.ToFXColor();
		return color;
	}

	public Object TransparencySlider( double x, double y, double xSlider, double BrightnessMultiplyer, int Gradations, double OpacityBefore, double OpacityAfter )
	{
		int xRectangleQuantity = 4, yRectangleQuantity = 6;
		
		for ( xRectangleNum = 0; xRectangleNum < xRectangleQuantity; xRectangleNum++ )
			if ( x >= bounds.getMinX() + bounds.getWidth() * xRectangleNum / xRectangleQuantity && x <= bounds.getMinX() + bounds.getWidth() * ( xRectangleNum + 1 ) / xRectangleQuantity )
				break;
		for ( yRectangleNum = 0; yRectangleNum < yRectangleQuantity; yRectangleNum++ )
			if ( y >= bounds.getMinY() + bounds.getHeight() * yRectangleNum / yRectangleQuantity && y <= bounds.getMinY() + bounds.getHeight() * ( yRectangleNum + 1 ) / yRectangleQuantity )
				break;
		xSlid = x - bounds.getMinX() - xRectangleNum * bounds.getWidth() - xSlider / xRectangleQuantity;
		while ( xSlid < 0 )
			xSlid = xSlid + bounds.getWidth() / xRectangleQuantity;
		while ( xSlid > bounds.getWidth() / xRectangleQuantity )
			xSlid = xSlid - bounds.getWidth() / xRectangleQuantity;
		
		switch ( yRectangleNum )
		{
		case 0:
			switch ( xRectangleNum )
			{
			case 0:
				colorTransparency = new TransparencySlider();
				break;
			case 1:
				colorTransparency = new TransparencySlider( white.fxColor );
				break;
			case 2:
				colorTransparency = new TransparencySlider( green.rgb );
				break;
			case 3:
				colorTransparency = new TransparencySlider( greenT.argb );
				break;
			}
			break;
		case 1:
			switch ( xRectangleNum )
			{
			case 0:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, greenT, purpleT );
				break;
			case 1:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, blueT, greenT, OpacityBefore );
				break;
			case 2:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, blueT, redT, OpacityBefore, OpacityAfter );
				break;
			case 3:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, redT, BrightnessMultiplyer, purpleT );
				break;
			}
			break;
		case 2:
			switch ( xRectangleNum )
			{
			case 0:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, blueT, BrightnessMultiplyer, brownT, OpacityBefore );
				break;
			case 1:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, yellowT, BrightnessMultiplyer, redT, OpacityBefore, OpacityAfter );
				break;
			case 2:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, Gradations, bronzeT, silverT );
				break;
			case 3:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, Gradations, silverT, goldT, OpacityBefore );
				break;
			}
			break;
		case 3:
			switch ( xRectangleNum )
			{
			case 0:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, Gradations, bronzeT, goldT, OpacityBefore, OpacityAfter );
				break;
			case 1:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, yellowT, blueT );
				break;
			case 2:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, orangeT, blueT, OpacityBefore );
				break;
			case 3:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, greenT, goldT, OpacityBefore, OpacityAfter );
				break;
			}
			break;
		case 4:
			switch ( xRectangleNum )
			{
			case 0:
				colorTransparency = new TransparencySlider ( colorTransparency.ToFXColor() );
				break;
			case 1:
				colorTransparency = new TransparencySlider ( colorTransparency.ToFXColor( pinkT.argb ) );
				break;
			case 2:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, blueT, oxylblue0FFT );
				int tempColorNum = (int)((int)( 255 * 16777216) + (int)(colorTransparency.ToFXColor().getRed() * 255 * 65536) + (int)(colorTransparency.ToFXColor().getGreen() * 255 * 256) + colorTransparency.ToFXColor().getBlue() * 255);
				if ( colorTransparency.ColorTooSimilarFunction( tempColorNum, oxylblue0FFNum ) )
					colorTransparency = neongreenT;
				break;
			case 3:
				colorTransparency.TransparencySliderFunction( bounds.getWidth() / xRectangleQuantity, xSlid, purpleT, oxylblue0FFT );
				if ( colorTransparency.ColorTooSimilarFunction( colorTransparency, oxylblue0FFT ) )
					colorTransparency = neongreenT;
				break;
			}
			break;
		case 5:
			switch ( xRectangleNum )
			{
			case 0:
				if ( 0 <= colorTransparency.ColorValueFitter(5000) && colorTransparency.ColorValueFitter(5000) <= 255  && 0 <= colorTransparency.ColorValueFitter(-5000) && colorTransparency.ColorValueFitter(-5000) <= 255 )
					colorTransparency = whiteT;
				else
					colorTransparency = blackT;
				break;
			case 1:
				color.set( fxColor.AQUAMARINE );
				break;
			case 2:
				colorTransparency.set( new double[]{255,134,0,1} );
				break;
			case 3:
				colorTransparency = new TransparencySlider ( (double[]) goldT.get() );
				break;
			}
			break;
		}
		argb = colorTransparency.argb;
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(colorTransparency.argb[z]);
			argb[z] = ColorValueFitter(argb[z]);
		}
		argb[3] = OpacityValueFitter(argb[3]);
		colorTransparency = new TransparencySlider( argb );
		fxColor = colorTransparency.ToFXColor();
		return colorTransparency;
	}

	public Object RainbowSoftColor( double x, double y, double xSlider, double BrightnessMultiplyer, int Gradations, Color[] FXcolorArray, double[][] ARGBcolorArray, double OpacityBefore, double OpacityAfter )
	//For Variated Gradations = 2147483647, For Rainbow 2 Fully Black Colors Into FXcolorArray, For Fully Opaque OpacityBefore = 1 & OpacityAfter = 1
	{
		int xRectangleQuantity = 2, yRectangleQuantity = 17;
		
		for ( xRectangleNum = 0; xRectangleNum < xRectangleQuantity; xRectangleNum++ )
			if ( x >= bounds.getMinX() + bounds.getWidth() * xRectangleNum / xRectangleQuantity && x <= bounds.getMinX() + bounds.getWidth() * ( xRectangleNum + 1 ) / xRectangleQuantity )
				break;
		for ( yRectangleNum = 0; yRectangleNum < yRectangleQuantity; yRectangleNum++ )
			if ( y >= bounds.getMinY() + bounds.getHeight() * yRectangleNum / yRectangleQuantity && y <= bounds.getMinY() + bounds.getHeight() * ( yRectangleNum + 1 ) / yRectangleQuantity )
				break;
		xSlid = x - bounds.getMinX() - xRectangleNum * bounds.getWidth() - xSlider / xRectangleQuantity;//?( 4./7. ) * ?SEEMS LIKE ( 9./16. ) * Before xSlider / .. SHOULD BE Gone Or ( 3./4. ) Instead To Be Rectified To 1 When Multiplied By 4/3
		while ( xSlid < 0 )
			xSlid = xSlid + bounds.getWidth() / xRectangleQuantity;
		while ( xSlid > bounds.getWidth() / xRectangleQuantity )
			xSlid = xSlid - bounds.getWidth() / xRectangleQuantity;
		xSlid = ( 4./3. ) * xSlid - bounds.getWidth() / ( 6. * xRectangleQuantity );
		
		switch ( xRectangleNum )
		{
		case 0://1st Column
			switch ( yRectangleNum )
			{
			case 0:
				rainbowSoftColor = new RainbowSoftColor();
				break;
			case 1:
				rainbowSoftColor = new RainbowSoftColor( white.fxColor );
				break;
			case 2:
				argb = new double[] { green.rgb[0], green.rgb[1], green.rgb[2], 1 };
				rainbowSoftColor = new RainbowSoftColor( argb );
				break;
			case 3:
				rainbowSoftColor.RainbowSoftColorRainbowFunction( bounds.getWidth() / xRectangleQuantity, xSlid );
				break;
			case 4:
				rainbowSoftColor.RainbowSoftColorFunction( bounds.getWidth() / xRectangleQuantity, xSlid, new RainbowSoftColor ( green.ToFXColor() ), new RainbowSoftColor ( purple.ToFXColor() ) );
				break;
			case 5:
				rainbowSoftColor.RainbowSoftColorFunction( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, new RainbowSoftColor ( blue.ToFXColor() ), new RainbowSoftColor ( green.ToFXColor() ), true, OpacityBefore, OpacityAfter );
				break;
			case 6:
				rainbowSoftColor.RainbowSoftColorRainbowFunctionReverse( bounds.getWidth() / xRectangleQuantity, xSlid );
				break;
			case 7:
				rainbowSoftColor.RainbowSoftCustomColorFunction ( bounds.getWidth() / xRectangleQuantity, xSlid, ARGBcolorArray );
				break;
			case 8:
				rainbowSoftColor.RainbowSoftCustomColorFunction ( bounds.getWidth() / xRectangleQuantity, xSlid, FXcolorArray );
				break;
			case 9:
				rainbowSoftColor.RainbowSoftColorRainbowFunctionUnAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations );
				break;
			case 10:
				rainbowSoftColor.RainbowSoftColorRainbowFunctionReverseUnAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations );
				break;
			case 11:
				rainbowSoftColor.RainbowSoftColorRainbowFunctionAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations );
				break;
			case 12:
				rainbowSoftColor.RainbowSoftColorRainbowFunctionReverseAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations );
				break;
			case 13:
				rainbowSoftColor.RainbowSoftColorRainbowTransparencyFunctionUnAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, OpacityBefore, OpacityAfter );
				break;
			case 14:
				rainbowSoftColor.RainbowSoftColorRainbowTransparencyFunctionReverseUnAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, OpacityBefore, OpacityAfter );
				break;
			case 15:
				rainbowSoftColor.RainbowSoftCustomColorFunctionUnAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, ARGBcolorArray );
				break;
			case 16://17th Square
				rainbowSoftColor.RainbowSoftCustomColorFunctionUnAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, FXcolorArray );
				break;
			}
			break;
		case 1://2nd Column
			switch ( yRectangleNum )
			{
			case 0://18th Square
				rainbowSoftColor.RainbowSoftCustomColorFunctionAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, ARGBcolorArray );
				break;
			case 1:
				rainbowSoftColor.RainbowSoftCustomColorFunctionAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, FXcolorArray );
				break;
			case 2:
				rainbowSoftColor.RainbowSoftCustomColorTransparencyFunctionUnAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, ARGBcolorArray, OpacityBefore, OpacityAfter );
				break;
			case 3:
				rainbowSoftColor.RainbowSoftCustomColorTransparencyFunctionUnAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, FXcolorArray, OpacityBefore, OpacityAfter );
				break;
			case 4:
				rainbowSoftColor.RainbowSoftColorRainbowTransparencyFunctionAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, OpacityBefore, OpacityAfter );
				break;
			case 5:
				rainbowSoftColor.RainbowSoftColorRainbowTransparencyFunctionReverseAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, OpacityBefore, OpacityAfter );
				break;
			case 6:
				rainbowSoftColor.RainbowSoftCustomColorTransparencyFunctionAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, ARGBcolorArray, OpacityBefore, OpacityAfter );
				break;
			case 7:
				rainbowSoftColor.RainbowSoftCustomColorTransparencyFunctionAdjusted ( bounds.getWidth() / xRectangleQuantity, xSlid, BrightnessMultiplyer, Gradations, FXcolorArray, OpacityBefore, OpacityAfter );
				break;
			case 8://26th Square DiagnosticsClass.java
				rainbowSoftColor = new RainbowSoftColor ( bronzeT.argb );
				rainbowSoftColor = new RainbowSoftColor ( rainbowSoftColor.ToFXColor() );
				break;
			case 9:
				rainbowSoftColor = new RainbowSoftColor ( rainbowSoftColor.ToFXColor( silverT.argb ) );
				break;
			case 10:
				rainbowSoftColor.RainbowSoftColorFunction( bounds.getWidth() / xRectangleQuantity, xSlid, new RainbowSoftColor ( blue.ToFXColor() ), new RainbowSoftColor ( oxylblue.ToFXColor() ) );
				int tempColorNum = (int)((int)( 255 * 16777216) + (int)(rainbowSoftColor.ToFXColor().getRed() * 255 * 65536) + (int)(rainbowSoftColor.ToFXColor().getGreen() * 255 * 256) + rainbowSoftColor.ToFXColor().getBlue() * 255);
				if ( rainbowSoftColor.ColorTooSimilarFunction( tempColorNum, oxylblue0FFNum ) )
					rainbowSoftColor = new RainbowSoftColor( neongreen.ToFXColor() );
				break;
			case 11:
				rainbowSoftColor.RainbowSoftColorFunction( bounds.getWidth() / xRectangleQuantity, xSlid, new RainbowSoftColor ( purple.ToFXColor() ), new RainbowSoftColor ( oxylblue0FF.ToFXColor() ) );
				if ( rainbowSoftColor.ColorTooSimilarFunction( rainbowSoftColor.ToFXColor(), oxylblue0FF.ToFXColor() ) )
					rainbowSoftColor = new RainbowSoftColor( neongreen.ToFXColor() );
				break;
			case 12:
				if ( 0 <= rainbowSoftColor.ColorValueFitter(5000) && rainbowSoftColor.ColorValueFitter(5000) <= 255  && 0 <= rainbowSoftColor.ColorValueFitter(-5000) && rainbowSoftColor.ColorValueFitter(-5000) <= 255 )
					rainbowSoftColor = new RainbowSoftColor ( white.ToFXColor() );
				else
					rainbowSoftColor = new RainbowSoftColor ( black.ToFXColor() );
				break;
			case 13:
				if ( 0 <= rainbowSoftColor.OpacityValueFitter(100) && rainbowSoftColor.OpacityValueFitter(100) <= 1  && 0 <= rainbowSoftColor.OpacityValueFitter(-100) && rainbowSoftColor.OpacityValueFitter(-100) <= 1 )
					rainbowSoftColor = new RainbowSoftColor ( white.ToFXColor() );
				else
					rainbowSoftColor = new RainbowSoftColor ( black.ToFXColor() );
				break;
			case 14:
				rainbowSoftColor.set( new double[]{255,134,0,1} );
				break;
			case 15:
				rainbowSoftColor.set( fxColor.AQUAMARINE );
				break;
			case 16:
				rainbowSoftColor = new RainbowSoftColor ( gold.ToFXColor() );
				rainbowSoftColor.set( (double[])rainbowSoftColor.get() );
				break;
			}
			break;
		}
		argb = rainbowSoftColor.argb;
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(rainbowSoftColor.argb[z]);
			argb[z] = ColorValueFitter(argb[z]);
		}
		argb[3] = OpacityValueFitter(argb[3]);
		rainbowSoftColor = new RainbowSoftColor( argb );
		fxColor = rainbowSoftColor.ToFXColor();// */
		return rainbowSoftColor;
	}

	public Object RainbowSoftColorGlobalRainbowSoftSelector( double x, double y, double xSlider, double BrightnessMultiplyer, int Gradations, boolean Adjusted, Color[] FXcolorArray, /* double[][] ARGBcolorArray, */ double OpacityBefore, double OpacityAfter, boolean Reversed, boolean IsColorNum )
	{
		rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, 1, 2147483647, false, doubleBlack, 1, 1, false, false);
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, 1, 2147483647, false, doubleBlack, 1, 1, true, false);
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, 1, 2147483647, false, imperialFXcolors, 1, 1, false, true );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, 1, 2147483647, false, imperialFXcolors, 1, 1, false, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, false, doubleBlack, 1, 1, false, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, false, doubleBlack, 1, 1, true, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, true, doubleBlack, 1, 1, false, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, true, doubleBlack, 1, 1, true, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, false, doubleBlack, 0, 1, false, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, false, doubleBlack, 0, 1, true, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, false, imperialFXcolors, 1, 1, false, true );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, false, imperialFXcolors, 1, 1, false, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, true, imperialFXcolors, 1, 1, false, true );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, true, imperialFXcolors, 1, 1, false, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, false, imperialFXcolors, 0, 1, false, true );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, false, imperialFXcolors, 0, 1, false, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, true, doubleBlack, 0, 1, false, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, true, doubleBlack, 0, 1, true, false );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, true, imperialFXcolors, 0, 1, false, true );
		//rainbowSoftColor.GlobalRainbowSoftSelectorFunction( xSlider, xSlid, BrightnessMultiplyer, Gradations, true, imperialFXcolors, 0, 1, false, false );// */
		return colorTransparency.ToFXColor();
	}

	//public Object RainbowSoftColor( double x, double y, double xSlider, double BrightnessMultiplyer, int Gradations, boolean Adjusted, FXcolorArray )
	//{ }

	public Boolean ColorTooSimilarFunction(ColorSlider Color1, ColorSlider Color2)
	{
		Boolean TooSimilar = false;
		int colorDifference = (int)( Math.abs(Color1.rgb[0] - Color2.rgb[0]) + Math.abs(Color1.rgb[1] - Color2.rgb[1]) + Math.abs(Color1.rgb[2] - Color2.rgb[2]) );
		if ( colorDifference <= 164 )
			TooSimilar = true;
		else
			TooSimilar = false;
		//System.out.println("colorDifference: " + colorDifference);
		//System.out.println(TooSimilar);
		return TooSimilar;
	}
	public double ColorValueFitter ( double ColorToBeChecked )
	{
		colorBeingChecked = Math.abs(ColorToBeChecked);
		while ( colorBeingChecked > 255)
			colorBeingChecked = colorBeingChecked - 255;
		return colorBeingChecked;
	}
	public double OpacityValueFitter ( double OpacityToBeChecked )
	{
		opacityBeingChecked = Math.abs(OpacityToBeChecked);
		while ( opacityBeingChecked > 1)
			opacityBeingChecked = opacityBeingChecked - 1;
		return opacityBeingChecked;
	}
	public void set(double[] RGB) { rgb = RGB; fxColor = fxColor.rgb( (int)(ColorValueFitter(rgb[0])), (int)(ColorValueFitter(rgb[1])), (int)(ColorValueFitter(rgb[2])) ); }//13th Square BasicDiagnosticsClass.java
	public void set(Color FXColor) { fxColor = FXColor; rgb = new double[] { ColorValueFitter(fxColor.getRed() * 255), ColorValueFitter(fxColor.getGreen() * 255), ColorValueFitter(fxColor.getBlue() * 255) }; }//14th Square BasicDiagnosticsClass.java
	public Object get() { return rgb; }
}
