package rainbowPackage;

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

public final class TransparencySlider //Basic Class For Variating Colors And Determining Transparency For RainbowSoftColor.java Class
{
	public double[] argb = {0,0,0,1};
	public Color fxColor;
	public boolean tooSimilar = false;// = {0,0,0};
	public int currentColorDifference = 0;
	public double colorBeingChecked = 0, opacityBeingChecked = 1;//, ColorToBeChecked = 0;
	//ColorValueFit colorValueFit = new ColorValueFit(0.);
	public TransparencySlider()//1st Square DiagnosticsClass.java
	{
		argb = new double[]{0,0,0,1};
		fxColor = Color.BLACK;
	}
	public TransparencySlider( Color FXColor )//2nd Square DiagnosticsClass.java
	{
		fxColor = FXColor;
		argb = new double[] { ToTwoFiveFivergb(fxColor.getRed()), ToTwoFiveFivergb(fxColor.getGreen()), ToTwoFiveFivergb(fxColor.getBlue()), fxColor.getOpacity() };
	}
	public TransparencySlider( double[] ARGB )//3rd & 4th Square DiagnosticsClass.java
	{
		if ( ARGB.length < 4 )
			argb = new double[] { ColorValueFitter(ARGB[0]),ColorValueFitter(ARGB[1]),ColorValueFitter(ARGB[2]),1.};
		else
			argb = new double[] { ColorValueFitter(ARGB[0]),ColorValueFitter(ARGB[1]),ColorValueFitter(ARGB[2]),OpacityValueFitter(ARGB[3])};
		fxColor = Color.rgb((int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, Color ColorAfter)//5th Square DiagnosticsClass.java
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Loc/ColorInterval - ColorAfter.getRed() * ( ColorInterval - Loc )/ColorInterval ) );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Loc/ColorInterval - ColorAfter.getGreen() * ( ColorInterval - Loc )/ColorInterval ) );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Loc/ColorInterval - ColorAfter.getBlue() * ( ColorInterval - Loc )/ColorInterval ) );
		argb[3] = 1;
		fxColor = Color.rgb((int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, Color ColorAfter, double Opacity)//6th Square DiagnosticsClass.java
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Loc/ColorInterval - ColorAfter.getRed() * ( ColorInterval - Loc )/ColorInterval ) );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Loc/ColorInterval - ColorAfter.getGreen() * ( ColorInterval - Loc )/ColorInterval ) );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Loc/ColorInterval - ColorAfter.getBlue() * ( ColorInterval - Loc )/ColorInterval ) );
		argb[3] = OpacityValueFitter( Opacity );
		fxColor = Color.rgb((int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, Color ColorAfter, double OpacityBefore, double OpacityAfter)//7th Square DiagnosticsClass.java
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Loc/ColorInterval - ColorAfter.getRed() * ( ColorInterval - Loc )/ColorInterval ) );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Loc/ColorInterval - ColorAfter.getGreen() * ( ColorInterval - Loc )/ColorInterval ) );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Loc/ColorInterval - ColorAfter.getBlue() * ( ColorInterval - Loc )/ColorInterval ) );
		argb[3] = OpacityValueFitter(  OpacityAfter + OpacityBefore - OpacityBefore * Loc/ColorInterval - OpacityAfter * ( ColorInterval - Loc )/ColorInterval );
		fxColor = Color.rgb((int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, double BrightnessMultiplyer, Color ColorAfter)//8th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb( ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Loc/ColorInterval - ColorAfter.getRed() * ( ColorInterval - Loc )/ColorInterval );
		argb[1] = ToTwoFiveFivergb( ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Loc/ColorInterval - ColorAfter.getGreen() * ( ColorInterval - Loc )/ColorInterval );
		argb[2] = ToTwoFiveFivergb( ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Loc/ColorInterval - ColorAfter.getBlue() * ( ColorInterval - Loc )/ColorInterval );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for ( int z = 0; z <= 2; z++ )
				argb[z] = ColorValueFitter( argb[z] * BrightnessMultiplyer );
		else
		{
			for (int z = 0; z <= 2; z++)
			{
				argb[z] = (int) ( argb[z] + ( argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( argb[z] > 255 )
					argb[z] = 255;	
				argb[z] = ColorValueFitter( argb[z]);
			}
		}
		argb[3] = 1;
		fxColor = Color.rgb((int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, double BrightnessMultiplyer, Color ColorAfter, double Opacity)//9th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb( ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Loc/ColorInterval - ColorAfter.getRed() * ( ColorInterval - Loc )/ColorInterval );
		argb[1] = ToTwoFiveFivergb( ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Loc/ColorInterval - ColorAfter.getGreen() * ( ColorInterval - Loc )/ColorInterval );
		argb[2] = ToTwoFiveFivergb( ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Loc/ColorInterval - ColorAfter.getBlue() * ( ColorInterval - Loc )/ColorInterval );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for ( int z = 0; z <= 2; z++ )
				argb[z] = ColorValueFitter( argb[z] * BrightnessMultiplyer );
		else
		{
			for (int z = 0; z <= 2; z++)
			{
				argb[z] = (int) ( argb[z] + ( argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( argb[z] > 255 )
					argb[z] = 255;
				argb[z] = ColorValueFitter( argb[z]);
			}
		}
		argb[3] = OpacityValueFitter( Opacity );
		fxColor = Color.rgb((int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, double BrightnessMultiplyer, Color ColorAfter, double OpacityBefore, double OpacityAfter)//10th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb( ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Loc/ColorInterval - ColorAfter.getRed() * ( ColorInterval - Loc )/ColorInterval );
		argb[1] = ToTwoFiveFivergb( ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Loc/ColorInterval - ColorAfter.getGreen() * ( ColorInterval - Loc )/ColorInterval );
		argb[2] = ToTwoFiveFivergb( ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Loc/ColorInterval - ColorAfter.getBlue() * ( ColorInterval - Loc )/ColorInterval );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for ( int z = 0; z <= 2; z++ )
				argb[z] = ColorValueFitter( argb[z] * BrightnessMultiplyer );
		else
		{
			for (int z = 0; z <= 2; z++)
			{
				argb[z] = (int) ( argb[z] + ( argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( argb[z] > 255 )
					argb[z] = 255;	
				argb[z] = ColorValueFitter( argb[z]);
			}
		}
		argb[3] = OpacityValueFitter(  OpacityAfter + OpacityBefore - OpacityBefore * Loc/ColorInterval - OpacityAfter * ( ColorInterval - Loc )/ColorInterval );
		fxColor = Color.rgb((int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, int Gradations, Color ColorBefore, Color ColorAfter )//11th Square DiagnosticsClass.java
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getRed() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) ) );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getGreen() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) ) );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getBlue() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) ) );
		argb[3] = 1;
		fxColor = Color.rgb((int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, int Gradations, Color ColorBefore, Color ColorAfter, double Opacity)//12th Square DiagnosticsClass.java
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getRed() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) ) );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getGreen() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) ) );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getBlue() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) ) );
		argb[3] = OpacityValueFitter( Opacity );
		fxColor = Color.rgb( (int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, int Gradations, Color ColorBefore, Color ColorAfter, double OpacityBefore, double OpacityAfter)//13th Square DiagnosticsClass.java
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getRed() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) ) );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getGreen() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) ) );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getBlue() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) ) );
		argb[3] = OpacityValueFitter( OpacityAfter + OpacityBefore - OpacityBefore * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - OpacityAfter * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		fxColor = Color.rgb( (int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter(argb[3]) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, double BrightnessMultiplyer, int Gradations, Color ColorBefore, Color ColorAfter)//14th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb(ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getRed() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getGreen() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getBlue() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for ( int z = 0; z <= 2; z++ )
				argb[z] = ColorValueFitter( argb[z] * BrightnessMultiplyer );
		else
		{
			for (int z = 0; z <= 2; z++)
			{
				argb[z] = (int) ( argb[z] + ( argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( argb[z] > 255 )
					argb[z] = 255;	
				argb[z] = ColorValueFitter( argb[z]);
			}
		}
		argb[3] = 1;
		fxColor = Color.rgb((int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, double BrightnessMultiplyer, int Gradations, Color ColorBefore, Color ColorAfter, double Opacity)//15th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb( ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getRed() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		argb[1] = ToTwoFiveFivergb( ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getGreen() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		argb[2] = ToTwoFiveFivergb( ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getBlue() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for ( int z = 0; z <= 2; z++ )
				argb[z] = ColorValueFitter( argb[z] * BrightnessMultiplyer );
		else
		{
			for (int z = 0; z <= 2; z++)
			{
				argb[z] = (int) ( argb[z] + ( argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( argb[z] > 255 )
					argb[z] = 255;
				argb[z] = ColorValueFitter( argb[z]);	
			}
		}
		argb[3] = OpacityValueFitter( Opacity );
		fxColor = Color.rgb( (int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color TransparencySliderFunction(double ColorInterval, double Loc, double BrightnessMultiplyer, int Gradations, Color ColorBefore, Color ColorAfter, double OpacityBefore, double OpacityAfter)//16th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb( ColorAfter.getRed() + ColorBefore.getRed() - ColorBefore.getRed() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getRed() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		argb[1] = ToTwoFiveFivergb( ColorAfter.getGreen() + ColorBefore.getGreen() - ColorBefore.getGreen() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getGreen() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		argb[2] = ToTwoFiveFivergb( ColorAfter.getBlue() + ColorBefore.getBlue() - ColorBefore.getBlue() * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ColorAfter.getBlue() * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		if ( BrightnessMultiplyer <= 1 && BrightnessMultiplyer >= 0 )
			for ( int z = 0; z <= 2; z++ )
				argb[z] = ColorValueFitter( argb[z] * BrightnessMultiplyer );
		else
		{
			for (int z = 0; z <= 2; z++)
			{
				argb[z] = (int) ( argb[z] + ( argb[z] + 4 ) * ( BrightnessMultiplyer - 1 ) );
				if ( argb[z] > 255 )
					argb[z] = 255;
				argb[z] = ColorValueFitter( argb[z]);
			}
		}
		argb[3] = OpacityValueFitter( OpacityAfter + OpacityBefore - OpacityBefore * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - OpacityAfter * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) );
		fxColor = Color.rgb( (int)argb[0], (int)argb[1], (int)argb[2], OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public Color CombineColors ( Color BackColor, Color FrontColor )//Combines Colors From Back To Front And Adds Opacity
	{
		//argb[0] = ColorValueFitter( ToTwoFiveFivergb( ( FrontColor.getRed() * FrontColor.getOpacity() + 2. * BackColor.getRed() * BackColor.getOpacity() ) / 2. ) );// + 255. - 255. * FrontColor.getOpacity() + FrontColor.getOpacity() * BackColor.getRed() * BackColor.getOpacity() - FrontColor.getRed() * FrontColor.getOpacity() * ( 1. - BackColor.getOpacity() ) ) / 2. );
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(FrontColor.getRed() * FrontColor.getOpacity() + BackColor.getRed() * BackColor.getOpacity() * ( 1. - FrontColor.getOpacity() ) ) );// + 255. - 255. * FrontColor.getOpacity() + FrontColor.getOpacity() * BackColor.getRed() * BackColor.getOpacity() - FrontColor.getRed() * FrontColor.getOpacity() * ( 1. - BackColor.getOpacity() ) ) / 2. );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(FrontColor.getGreen() * FrontColor.getOpacity() + BackColor.getGreen() * BackColor.getOpacity() * ( 1. - FrontColor.getOpacity() ) ) );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(FrontColor.getBlue() * FrontColor.getOpacity() + BackColor.getBlue() * BackColor.getOpacity() * ( 1. - FrontColor.getOpacity() ) ) );
		argb[3] = OpacityValueFitter( ( FrontColor.getOpacity() + 2. * BackColor.getOpacity() ) / 2.); //FrontColor.getOpacity() + BackColor.getOpacity() * ( 1. - FrontColor.getOpacity() ) );//2. / ( FrontColor.getOpacity() + BackColor.getOpacity() + 0.01 ) - 2. /* 2. In Both Places In This Equation = Number Of Colors Combined */ / ( 2.01 - FrontColor.getOpacity() - BackColor.getOpacity() ) );// + 1. / ( 1. + Math.pow( Math.E, - FrontColor.getOpacity() + BackColor.getOpacity() ) ) / 2. ) );
		fxColor = Color.rgb( (int)argb[0], (int)argb[1], (int)argb[2], argb[3] );
		return fxColor;
	}
	//public Color CombineColorWithEmmitter ( Color NonEmitter, Color Emitter )
	//public Color CombineEmitters ( Color NonEmitter, Color Emitter )
	public Color ToFXColor ()//17th Square DiagnosticsClass.java
	{
		return fxColor;
	}
	public Color ToFXColor ( double[] ARGB )//18th Square DiagnosticsClass.java
	{
		if ( ARGB.length < 4 )
			argb = new double[] { ColorValueFitter(ARGB[0]),ColorValueFitter(ARGB[1]),ColorValueFitter(ARGB[2]),1.};
		else
			argb = ARGB;
		fxColor = Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
		return fxColor;
	}
	public int ToARGBcolorNum ()//8th Square DiagnosticsClass.java
	{
		//fxColor = Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
		return (int)( argb[3] * 256 * 16777216 + argb[0] * 65536 + argb[1] * 256 + argb[2] );
	}
	public int ToARGBcolorNum ( double[] ARGB )//9th Square DiagnosticsClass.java
	{
		if ( ARGB.length < 4 )
			argb = new double[] { ColorValueFitter(ARGB[0]),ColorValueFitter(ARGB[1]),ColorValueFitter(ARGB[2]),1.};
		else
			argb = ARGB;
		fxColor = Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
		return (int)( argb[3] * 256 * 16777216 + argb[0] * 65536 + argb[1] * 256 + argb[2] );
	}
	public int ToARGBcolorNum ( Color FXColor )//9th Square DiagnosticsClass.java
	{
		argb = new double[] { ToTwoFiveFivergb(FXColor.getRed()), ToTwoFiveFivergb(FXColor.getGreen()), ToTwoFiveFivergb(FXColor.getBlue()), FXColor.getOpacity() };
		fxColor = FXColor;
		return (int)( argb[3] * 256 * 16777216 + argb[0] * 65536 + argb[1] * 256 + argb[2] );
	}
	//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)//4th Square DiagnosticsClass.java
	{
		tooSimilar = false;
		currentColorDifference = (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 ( currentColorDifference <= 164 )//200 )
			tooSimilar = true;
		else
			tooSimilar = false;
		return tooSimilar;
	}
	public Boolean ColorTooSimilarFunction(TransparencySlider Color1, TransparencySlider Color2)//20th Square DiagnosticsClass.java
	{
		tooSimilar = false;
		int colorDifference = (int)( Math.abs(Color1.argb[0] - Color2.argb[0]) + Math.abs(Color1.argb[1] - Color2.argb[1]) + Math.abs(Color1.argb[2] - Color2.argb[2]) + 255 * Math.abs(Color1.argb[3] - Color2.argb[3]) );
		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 Boolean ColorTooSimilarFunction(TransparencySlider Color1, TransparencySlider Color2, double ColorDifference )//20th Square DiagnosticsClass.java
	{
		tooSimilar = false;
		int colorDifference = (int)( Math.abs(Color1.argb[0] - Color2.argb[0]) + Math.abs(Color1.argb[1] - Color2.argb[1]) + Math.abs(Color1.argb[2] - Color2.argb[2]) + 255 * Math.abs(Color1.argb[3] - Color2.argb[3]) );
		if ( colorDifference <= ColorDifference )
			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 double ColorValueFitterCapper ( double ColorToBeChecked )//30th Square DiagnosticsClass.java
	{
		colorBeingChecked = ColorToBeChecked;
		while ( colorBeingChecked < 0 )
			colorBeingChecked = 0;
		while ( colorBeingChecked > 255 )
			colorBeingChecked = 255;
		return Math.round(colorBeingChecked);
	}
	public double OpacityValueFitterCapper ( double OpacityToBeChecked )//31st Square DiagnosticsClass.java
	{
		opacityBeingChecked = OpacityToBeChecked;
		while ( opacityBeingChecked < 0 )
			opacityBeingChecked = 0;
		while ( opacityBeingChecked > 1 )
			opacityBeingChecked = 1;
		return opacityBeingChecked;
	}
	public double ToTwoFiveFivergb ( double ZeroToOne )
	{	return 255 * ZeroToOne;	}
	public void set(double[] ARGB) { argb = ARGB; if ( ARGB.length == 3 ) argb = new double[] { (double)(ColorValueFitter(ARGB[0])), (double)(ColorValueFitter(ARGB[1])), (double)(ColorValueFitter(ARGB[2])), (double)OpacityValueFitter(1) }; fxColor = Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) ); }//23rd Square DiagnosticsClass.java
	public void set(Color FXColor) { fxColor = FXColor; argb = new double[] { fxColor.getRed() * 255, fxColor.getGreen() * 255, fxColor.getBlue() * 255, fxColor.getOpacity() }; }//24th Square DiagnosticsClass.java
	public Color get() { return fxColor; }
	//public Object get() { return fxColor; }
}
