package rainbowPackage;

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

public 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 = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, Color ColorAfter)//5th Square DiagnosticsClass.java
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getRed()) * ( ColorInterval - Loc )/ColorInterval );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getGreen()) * ( ColorInterval - Loc )/ColorInterval );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getBlue()) * ( ColorInterval - Loc )/ColorInterval );
		argb[3] = 1;
		fxColor = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, Color ColorAfter, double Opacity)//6th Square DiagnosticsClass.java
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getRed()) * ( ColorInterval - Loc )/ColorInterval );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getGreen()) * ( ColorInterval - Loc )/ColorInterval );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getBlue()) * ( ColorInterval - Loc )/ColorInterval );
		argb[3] = OpacityValueFitter( Opacity );
		fxColor = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, Color ColorAfter, double OpacityBefore, double OpacityAfter)//7th Square DiagnosticsClass.java
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getRed()) * ( ColorInterval - Loc )/ColorInterval );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getGreen()) * ( ColorInterval - Loc )/ColorInterval );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getBlue()) * ( ColorInterval - Loc )/ColorInterval );
		argb[3] = OpacityValueFitter(  OpacityAfter + OpacityBefore - OpacityBefore * Loc/ColorInterval - OpacityAfter * ( ColorInterval - Loc )/ColorInterval );
		fxColor = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, double BrightnessMultiplyer, Color ColorAfter)//8th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getRed()) * ( ColorInterval - Loc )/ColorInterval;
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getGreen()) * ( ColorInterval - Loc )/ColorInterval;;
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Loc/ColorInterval - ToTwoFiveFivergb(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 = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, double BrightnessMultiplyer, Color ColorAfter, double Opacity)//9th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getRed()) * ( ColorInterval - Loc )/ColorInterval;
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getGreen()) * ( ColorInterval - Loc )/ColorInterval;
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Loc/ColorInterval - ToTwoFiveFivergb(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 = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, Color ColorBefore, double BrightnessMultiplyer, Color ColorAfter, double OpacityBefore, double OpacityAfter)//10th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getRed()) * ( ColorInterval - Loc )/ColorInterval;
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Loc/ColorInterval - ToTwoFiveFivergb(ColorAfter.getGreen()) * ( ColorInterval - Loc )/ColorInterval;
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Loc/ColorInterval - ToTwoFiveFivergb(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 = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, int Gradations, Color ColorBefore, Color ColorAfter )//11th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getRed()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getGreen()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getBlue()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[3] = 1;
		fxColor = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, int Gradations, Color ColorBefore, Color ColorAfter, double Opacity)//12th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getRed()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getGreen()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getBlue()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[3] = OpacityValueFitter( Opacity );
		fxColor = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, int Gradations, Color ColorBefore, Color ColorAfter, double OpacityBefore, double OpacityAfter)//13th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getRed()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getGreen()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(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 = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, double BrightnessMultiplyer, int Gradations, Color ColorBefore, Color ColorAfter)//14th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getRed()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getGreen()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(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 = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void TransparencySliderFunction(double ColorInterval, double Loc, double BrightnessMultiplyer, int Gradations, Color ColorBefore, Color ColorAfter, double Opacity)//15th Square DiagnosticsClass.java
	{
		argb[0] = ToTwoFiveFivergb(ColorAfter.getRed()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getRed()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getGreen()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(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 = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void 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()) + ToTwoFiveFivergb(ColorBefore.getRed()) - ToTwoFiveFivergb(ColorBefore.getRed()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getRed()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[1] = ToTwoFiveFivergb(ColorAfter.getGreen()) + ToTwoFiveFivergb(ColorBefore.getGreen()) - ToTwoFiveFivergb(ColorBefore.getGreen()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(ColorAfter.getGreen()) * Math.floor( ( ColorInterval - Loc )/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 );
		argb[2] = ToTwoFiveFivergb(ColorAfter.getBlue()) + ToTwoFiveFivergb(ColorBefore.getBlue()) - ToTwoFiveFivergb(ColorBefore.getBlue()) * Math.floor( Loc/ColorInterval * ( Gradations + 2 ) ) / ( Gradations + 1 ) - ToTwoFiveFivergb(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 = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	public void CombineColors ( Color BackColor, Color FrontColor )//Combines Colors From Back To Front And Adds Opacity
	{
		argb[0] = ColorValueFitter( ToTwoFiveFivergb(FrontColor.getRed()) * FrontColor.getOpacity() + ToTwoFiveFivergb(BackColor.getRed()) * BackColor.getOpacity() * ( 1. - FrontColor.getOpacity() ) );// + 255. - 255. * FrontColor.getOpacity() + FrontColor.getOpacity() * ToTwoFiveFivergb(BackColor.getRed()) * BackColor.getOpacity() - ToTwoFiveFivergb(FrontColor.getRed()) * FrontColor.getOpacity() * ( 1. - BackColor.getOpacity() ) ) / 2. );
		argb[1] = ColorValueFitter( ToTwoFiveFivergb(FrontColor.getGreen()) * FrontColor.getOpacity() + ToTwoFiveFivergb(BackColor.getGreen()) * BackColor.getOpacity() * ( 1. - FrontColor.getOpacity() ) );
		argb[2] = ColorValueFitter( ToTwoFiveFivergb(FrontColor.getBlue()) * FrontColor.getOpacity() + ToTwoFiveFivergb(BackColor.getBlue()) * BackColor.getOpacity() * ( 1. - FrontColor.getOpacity() ) );
		argb[3] = OpacityValueFitter( 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 = javafx.scene.paint.Color.rgb((int)ColorValueFitter( argb[0] ), (int)ColorValueFitter( argb[1] ), (int)ColorValueFitter( argb[2] ), OpacityValueFitter( argb[3] ) );
	}
	//public void CombineColorWithEmmitter ( Color NonEmitter, Color Emitter )
	//public void 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 = javafx.scene.paint.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 = javafx.scene.paint.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 = javafx.scene.paint.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 = javafx.scene.paint.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 Object get() { return fxColor; }
	//public Object get() { return fxColor; }
}
