package rainbowPackage;

//import javafx.scene.paint.Paint.*;
import javafx.scene.image.PixelReader;
//import rainbowPackage.VibrantColors;
//import rainbowPackage.VibrantColorCombos;
//import rainbowPackage.RainbowSoftColorCodesSets;
//import javafx.scene.image.PixelWriter;
import javafx.scene.paint.Color;
import java.awt.Dimension;

public final class RainbowClock //RainbowSoft2D Houses A Series Of RainbowVideo.java Videos Or RainbowColorCodeSchemes.java For Frames

//FOR RainbowColorCodeSchemes.java! To Use RainbowSoftColorCodes And Access RainbowPattern2D.java Classes. This Class RainbowSoft2D Deals With Color Coding On 1 Layers To Make A Frame For RainbowVideo.java Which Accesses
{//This Class
	public static double[] rgb = {0,0,0}, argb = {0,0,0,1};
	public static Color fxColor = Color.BEIGE, tempColor = Color.OLIVE;//returnImmediatlyColor = fxColor.LAVENDER;
	public static Color[] fxColorArray = { Color.PINK, Color.SKYBLUE };
	//public static ArrayReverser arrayReverser = new ArrayReverser();
	public static ColorArrayReverser colorArrayReverser = new ColorArrayReverser();
	//public static ColorSlider tempColorSlider = new ColorSlider();
	public static TransparencySlider transparencySlider = new TransparencySlider( VibrantColors.Black );
	public static double colorBeingChecked = 0, opacityBeingChecked = 1;
	public static ColorFader tempColorFader = new ColorFader();
	public static ColorTooSimilar colorTooSimilarFunction = new ColorTooSimilar();
	//public static RainbowSoftColorCodesSets rainbowSoftColorCodesSets = new RainbowSoftColorCodesSets();
	public static double ColorBeingChecked = 0, OpacityBeingChecked = 1, sliderValue = 0, originalFormulaValue = 0, numberOfTransitions = 0, coreVariableStill = 0, coreTranisitionVariable = 0, eightColorDiamondsIndexStill = 0, eightColorDiamondsIndexMoving = 0, eightColorDiamondsIndex = 0;
	public static RainbowSoftColor rainbowSoftColor = new RainbowSoftColor( new double[]{0,0,0,1} );
	public static RainbowPattern2D pattern2D = new RainbowPattern2D( new double[]{0,0,0,1} );
	public static DisplayType displayType = new DisplayType();
	//public static ColorDecide colorDecide = new ColorDecide();
	public static Dimension halfedDim = new Dimension();
	public static boolean someTargetColorInTheCenterHit = false, greenBlueGreenUsed = false;// wheelTipsHit = false, someTargetColorHit = true, greenBlueGreenUsed = false, otherBrowserColorHit = false, makePixelTransparent = false, aColorBarHit = false, aWheelDiamondHit = false;
	static final int maxIndexOfHorizontalColorBars = 17, maxIndexOfVerticalColorBars = 3;
	static int colorBarIndex = 0, colorBarCheck = 0, colorBarDistance = 0;
	static boolean returnImmediately = false, laterReversed = false, someTargetColorHit = true, browserHit = false; //reversalOfBackgroundEffectsSlave = true;

	public RainbowClock( Color FXColor )//Creates Class And Sets Color With JavaFX Color Class //
	{
		fxColor = FXColor;
		rainbowSoftColor = new RainbowSoftColor( 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() };
	}
	public RainbowClock( double[] ARGB )//Creates Class And Sets Color With 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[4];
			for  (int z = 0; z <= 2; z++)
				argb[z] = ColorValueFitter(rgb[z]);
			ARGB[3] = 1;
		}
		else
			argb[3] = OpacityValueFitter(ARGB[3]);
		rainbowSoftColor = new RainbowSoftColor( argb );
		fxColor = rainbowSoftColor.ToFXColor();
	}
	public RainbowClock()//Creates Class And Sets Color To Opake Black //
	{
		rgb = new double[]{0,0,0};
		argb = new double[]{0,0,0,1};
		rainbowSoftColor = new RainbowSoftColor( rgb );
		fxColor = rainbowSoftColor.ToFXColor();
	}
	public Color ToFXColor()//Returns Color In JavaFX
	{
		fxColor = rainbowSoftColor.ToFXColor();
		//return VibrantColors.Red.ToFXColor();//TESTING ONLY
		return fxColor;
	}
	public Color ToFXColor( double[] ARGB )//Changes Class To ARGB Value And Returns Color In JavaFX //
	{
		for  (int z = 0; z <= 2; z++)
		{
			rgb[z] = ColorValueFitter(ARGB[z]);
			argb[z] = ColorValueFitter(ARGB[z]);
		}
		if ( ARGB.length == 3 )
		{
			argb = new double[4];
			for  (int z = 0; z <= 2; z++)
				argb[z] = ColorValueFitter(rgb[z]);
			ARGB[3] = 1;
		}
		else
			argb[3] = OpacityValueFitter(ARGB[3]);
		rainbowSoftColor = new RainbowSoftColor( argb );
		fxColor = rainbowSoftColor.ToFXColor();
		return fxColor;
	}

	public static final Color RainbowClock(double ColorsFactor, double LocationOfStillMovement, double LocationOfColorMovement, int x, int y, double RepeatFactor, double FullSliderRunThrough, double HalfSreenDiagionalLength, double XScaleFactor, double YScaleFactor, boolean Reversed, double BrightnessMultiplyer, int Gradations, double OpacityBefore, double OpacityAfter, boolean Adjusted, PixelReader BrowserPR, /*PixelWriter BrowserPW,*/ Dimension Dim, String TypeOfDisplay, Color InitialColorContrastingChoice, Color ColorTooSimilarReplacementColor, double ColorDifference, boolean InvertBasisFromBackground, boolean InvertInsteadOfReverse, boolean InvertBoth, boolean InvertJustOrigional, boolean InvertTextAlways,/*boolean ReversalOfBackgroundEffectsMaster,*/ boolean NextStepColorTooSimilarEffect, Color TextColorToOverlay, Color BackgroundColorToOverlay, boolean TextColorOverlay, boolean BackgroundColorOverlay )//Basic Example Of How Colors Change Then Go Through Final String Based Choice ReProcessing. Figure This Function Entirely Before Moving On If Analyzing RainbowSoft2D.
	{
		//double ringSize = 0.175979734764;
		pattern2D.set( VibrantColors.HalfGrey );
		rainbowSoftColor.set( VibrantColors.HalfGrey );
		halfedDim.width = (int)Math.round( Dim.width / 2. );//Check Into If This Is Right
		halfedDim.height = (int)Math.round( Dim.height / 2. );//Check Into If This Is Right
		someTargetColorHit = true; browserHit = false;
		laterReversed = Reversed; //reversalOfBackgroundEffectsSlave = ReversalOfBackgroundEffectsMaster;
		rainbowSoftColor.set( displayType.DisplayTypeDeterminer ( TypeOfDisplay, VibrantColors.Black, VibrantColors.Black, BrowserPR.getColor( x, y ), laterReversed ) );//reversalOfBackgroundEffectsSlave ) );//DisplayTypeDeterminer ( TypeOfDisplay, VibrantColors.Black, VibrantColors.Black, BrowserPR.getColor( x, y ), displayType.laterReversed, reversalOfBackgroundEffectsSlave ) );   //DisplayTypeDeterminer ( TypeOfDisplay, VibrantColors.Black, BrowserPR.getColor( x, y ), laterReversed )
		/*try { Thread.sleep(0,1);//primaryThread.sleep(1);
		} catch (InterruptedException e) {
			System.out.println("Interrupted.");
		}// */
		pattern2D.set( rainbowSoftColor.ToFXColor() );
		rgb = rainbowSoftColor.rgb;
		argb = rainbowSoftColor.argb;
		fxColor = rainbowSoftColor.ToFXColor();
		//browserHit = false;//UnComment For No Browser Fade In As Well As Use Just Below transparencySlider.
		if ( displayType.returnImmediately )
			//if ( browserHit )
			//{ //transparencySlider.set( new double[]{ 255. * BrowserPR.getColor( x, y ).getRed(), 255. * BrowserPR.getColor( x, y ).getGreen(), 255. * BrowserPR.getColor( x, y ).getBlue(), tempTransparencySlider.OpacityValueFitterCapper( 1.5 * LocationOfColorMovement / RepeatFactor ) } );//new double[]{ 255. * VibrantColors.Magenta.getRed(), 255. * VibrantColors.Magenta.getGreen(), 255. * VibrantColors.Magenta.getBlue(), 1. - LocationOfColorMovement / RepeatFactor }
			//return //transparencySlider.ToFXColor(); }
			//else
			return fxColor;
		//pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsReverseNoPink/*VibrantColorCombos.ImperialFXcolors*/, displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock And For Text Pixel Blending Testing
		//if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) || ( InvertTextAlways && displayType.laterReversed != Reversed ) )
		//	pattern2D.set( pattern2D.ToFXColor().invert() );
		//rainbowSoftColor.set( pattern2D.ToFXColor() );
		
		
		if ( !displayType.laterReversed )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWYellowDark, displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock
		else if ( !InvertInsteadOfReverse )//VibrantColorCombos.RainbowFXcolorsWNeonGreenCenterBrightBlueInsteadOfBlue/VibrantColorCombos.RainbowFXcolorsWNeonGreenCenterReverseBrightBlueInsteadOfBlue//
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsReverse, !displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		else
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsReverseNoPink, displayType.laterReversed );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) || ( InvertTextAlways && displayType.laterReversed != Reversed ) )
			pattern2D.set( pattern2D.ToFXColor().invert() );// */
		
		/*if ( !displayType.laterReversed )
		pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsReverseNoPink, displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock
		else if ( !InvertInsteadOfReverse )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWPinkCenter, !displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		else
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolors, displayType.laterReversed );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) || ( InvertTextAlways && displayType.laterReversed != Reversed ) )
			pattern2D.set( pattern2D.ToFXColor().invert() );// */
		
		/*if ( !displayType.laterReversed )
		pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolors, displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock
		else if ( !InvertInsteadOfReverse )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWNeonGreenCenterReverseBrightBlueInsteadOfBlue, !displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		else//RainbowFXcolorsWNeonGreenCenterReverseBrightBlueInsteadOfBlue/RainbowFXcolorsWNeonGreenCenterReverseNoTealOxylBlue//VibrantColorCombos.RainbowFXcolorsWYellowDark->ForWhiteBackground
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsReverseNoPink, displayType.laterReversed );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) || ( InvertTextAlways && displayType.laterReversed != Reversed ) )
			pattern2D.set( pattern2D.ToFXColor().invert() );// */
		
		/*if ( !displayType.laterReversed )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsReverseNoPink, displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock
		else if ( !InvertInsteadOfReverse )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWNeonGreenCenterBrightBlueInsteadOfBlue, !displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		else//VibrantColorCombos.RainbowFXcolorsWYellowDark/VibrantColorCombos.RainbowFXcolorsReverseWYellowDarkWOPink
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolors, displayType.laterReversed );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) || ( InvertTextAlways && displayType.laterReversed != Reversed ) )
			pattern2D.set( pattern2D.ToFXColor().invert() );// */
		
		/*if ( !displayType.laterReversed )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolors, displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock
		else if ( !InvertInsteadOfReverse )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWNeonGreenCenterReverse, !displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		else
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsReverseNoPink, displayType.laterReversed );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) || ( InvertTextAlways && displayType.laterReversed != Reversed ) )
			pattern2D.set( pattern2D.ToFXColor().invert() );// */
		
		/*if ( !displayType.laterReversed )
		pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWNeonGreenCenterReverse, displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock
		else if ( !InvertInsteadOfReverse )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWBlackCenter, !displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		else
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolors, displayType.laterReversed );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) || ( InvertTextAlways && displayType.laterReversed != Reversed ) )
			pattern2D.set( pattern2D.ToFXColor().invert() );// */
		
		/*if ( !displayType.laterReversed )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWNeonGreenCenterReverse, displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock
		else if ( !InvertInsteadOfReverse )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolors, !displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		else
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolors, displayType.laterReversed );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) || ( InvertTextAlways && displayType.laterReversed != Reversed ) )
			pattern2D.set( pattern2D.ToFXColor().invert() );// */
		
		/*if ( !displayType.laterReversed )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWNeonGreenCenterReverse, displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock
		else if ( !InvertInsteadOfReverse )
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsWBrownCenter, !displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		else
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolors, displayType.laterReversed );//Simple Double Slider 1 Rotation Rainbow Clock Reversed
		if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) || ( InvertTextAlways && displayType.laterReversed != Reversed ) )
			pattern2D.set( pattern2D.ToFXColor().invert() );// */
		
		
		if ( TextColorOverlay && displayType.laterReversed != Reversed )
		{
			//fxColor = fxColor.interpolate( TextColorToOverlay, 0.5 );
			//pattern2D.set( fxColor );
			//transparencySlider.CombineColors( pattern2D.ToFXColor(), TextColorToOverlay );
			transparencySlider.TransparencySliderFunction( 1.0, TextColorToOverlay.getOpacity(), pattern2D.ToFXColor(), TextColorToOverlay );
			pattern2D.set( transparencySlider.ToFXColor() );
		}
		if ( BackgroundColorOverlay && displayType.laterReversed == Reversed )
		{	
			//fxColor = fxColor.interpolate( BackgroundColorToOverlay, 0.5 );
			//pattern2D.set( fxColor );
			//transparencySlider.CombineColors( pattern2D.ToFXColor(), BackgroundColorToOverlay );
			transparencySlider.TransparencySliderFunction( 1.0, BackgroundColorToOverlay.getOpacity(), pattern2D.ToFXColor(), BackgroundColorToOverlay );
			pattern2D.set( transparencySlider.ToFXColor() );
		}
		rainbowSoftColor.set( pattern2D.ToFXColor() );
		
		/*if ( !displayType.laterReversed )
		{
			//transparencySlider.TransparencySliderFunction( RepeatFactor, LocationOfColorMovement, VibrantColors.Magenta, VibrantColors.ClearMagenta );
			//transparencySlider.set( VibrantColors.Magenta );
			/*if ( LocationOfColorMovement / RepeatFactor < 0.5)//UnComment Below To ColorDecide.NextColorDecide To Get Text Fade In Back And Fourth
				transparencySlider.set( new double[]{ 255. * BrowserPR.getColor( x, y ).getRed(), 255. * BrowserPR.getColor( x, y ).getGreen(), 255. * BrowserPR.getColor( x, y ).getBlue(), tempTransparencySlider.OpacityValueFitterCapper ( 1 - 6 * LocationOfColorMovement / RepeatFactor ) } );//1. - LocationOfColorMovement / RepeatFactor } );//new double[]{ 255. * VibrantColors.Magenta.getRed(), 255. * VibrantColors.Magenta.getGreen(), 255. * VibrantColors.Magenta.getBlue(), 1. - LocationOfColorMovement / RepeatFactor }
			else
				transparencySlider.set( new double[]{ 255. * BrowserPR.getColor( x, y ).getRed(), 255. * BrowserPR.getColor( x, y ).getGreen(), 255. * BrowserPR.getColor( x, y ).getBlue(), tempTransparencySlider.OpacityValueFitterCapper ( 2 * LocationOfColorMovement / RepeatFactor - 1 ) } );
			BrowserPW.setColor( x, y, transparencySlider.ToFXColor() );// #/
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, /*VibrantColorCombos.RainbowFXcolorsWPinkCenter,#/ displayType.laterReversed && !InvertInsteadOfReverse );//Simple Double Slider 1 Rotation Rainbow Clock
			if ( displayType.textTransitionFactor > 0 )
				pattern2D.TransparencySliderFunction( 1, displayType.textTransitionFactor, pattern2D.ToFXColor(), pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, /*VibrantColorCombos.RainbowFXcolorsReverse,#/ !( displayType.laterReversed && !InvertInsteadOfReverse ) ) );// #/
			if ( InvertBoth || InvertJustOrigional )
				pattern2D.set( pattern2D.ToFXColor().invert() );
			//transparencySlider.TransparencySliderFunction(ColorsFactor / RepeatFactor, LocationOfStillMovement / FullSliderRunThrough, VibrantColors.Green, VibrantColors.Pink );
			//pattern2D.set( transparencySlider.ToFXColor() );
			
			//System.out.println( "arrayReverser.Length(): " + arrayReverser.Length() );
			//tempTransparencySlider.CombineColors( pattern2D.ToFXColor(), transparencySlider.ToFXColor() );
			return ColorDecide.NextColorDecide ( VibrantColors.Black, VibrantColors.Black, pattern2D.ToFXColor(), BrowserPR.getColor( x, y ) /*tempTransparencySlider.ToFXColor()#/, InitialColorContrastingChoice, ColorTooSimilarReplacementColor, ColorDifference, someTargetColorHit, laterReversed == Reversed, NextStepColorTooSimilarEffect, InvertBasisFromBackground );
		}
		else
		{
			
			
			//pattern2D.RainbowRingGradated( ringSize * Dim.height / 2. * ColorsFactor / RepeatFactor, ringSize * halfedDim.height * LocationOfStillMovement / FullSliderRunThrough, ringSize * halfedDim.height * LocationOfColorMovement / FullSliderRunThrough + 29.22094508301405, ( x - ( Dim.width / 2. + 11. ) * XScaleFactor) * Dim.height / 1788., ( y - Dim.height / 2. + ( 1. - 8. ) ) * Dim.height / 783., ringSize * Dim.height / 2., (1. - ringSize ) * Dim.height / 2. - .5, Dim.height / 2., VibrantColorCombos.RainbowFXcolorsReverseNoPink, displayType.laterReversed && !InvertInsteadOfReverse, BrightnessMultiplyer, Gradations, OpacityBefore, OpacityAfter, Adjusted );//Figure Out What To Use Instead Of ColorsFactor
			//pattern2D.RainbowStrobeVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x, y, RepeatFactor, Dim, halfedDim, -HalfSreenDiagionalLength, VibrantColorCombos.RainbowFXcolorsReverseNoPink, displayType.laterReversed && !InvertInsteadOfReverse );//, BrightnessMultiplyer, Gradations, OpacityBefore, OpacityAfter, Adjusted );
			//pattern2D.SimpleCustomColor( 1880. * XScaleFactor * ColorsFactor / RepeatFactor, - 1880. * XScaleFactor * LocationOfStillMovement / FullSliderRunThrough, - 1880. * XScaleFactor * LocationOfColorMovement / FullSliderRunThrough, x - 1880. * XScaleFactor , 1880. * XScaleFactor , BrightnessMultiplyer, Gradations, VibrantColorCombos.RainbowFXcolorsReverseNoPink, OpacityBefore, OpacityAfter, Adjusted );
			//pattern2D.RainbowRingVaryated( ringSize * Dim.height / 2. * ColorsFactor / RepeatFactor, ringSize * halfedDim.height * LocationOfStillMovement / FullSliderRunThrough, ringSize * halfedDim.height * LocationOfColorMovement / FullSliderRunThrough + 29.22094508301405, ( x - Dim.width / 2. + 11.) * Dim.height / 3576., ( y - Dim.height / 2. + 1. - 8. ) * Dim.height / 1566., ringSize * Dim.height / 2., 0, 99999/*(1. - ringSize ) * Dim.height / 2. - .5, Dim.height / 2. #/, displayType.laterReversed && !InvertInsteadOfReverse );//, BrightnessMultiplyer, Gradations, OpacityBefore, OpacityAfter, Adjusted );
			//pattern2D.RainbowClockVaryated( ColorsFactor / RepeatFactor * Math.PI / 2., Math.PI * ( LocationOfStillMovement / FullSliderRunThrough ) / 2., - Math.PI * ( - LocationOfColorMovement / FullSliderRunThrough ) / 2., x - halfedDim.width, y - halfedDim.height, RepeatFactor / ColorsFactor * Math.PI / 2., VibrantColorCombos.RainbowFXcolors, displayType.laterReversed && !InvertInsteadOfReverse );//, BrightnessMultiplyer, Gradations, OpacityBefore, OpacityAfter, Adjusted );
			
			
			//System.out.println( "laterReversed != Reversed: " + ( laterReversed != Reversed ) );
			pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement,  x - halfedDim.width, y - halfedDim.height, RepeatFactor, VibrantColorCombos.RainbowFXcolorsReverseNoPink, displayType.laterReversed && !InvertInsteadOfReverse );// Simple Double Slider 1 Rotation Rainbow Clock Reversed */
			
			//Below 2 Lines For Testing Proper Text Pixel Blending
			//if ( displayType.textTransitionFactor > 0.01 )
			//	pattern2D.TransparencySliderFunction( 1, displayType.textTransitionFactor, pattern2D.ToFXColor(), pattern2D.RainbowClockVaryated( ColorsFactor, LocationOfStillMovement, LocationOfColorMovement, x - halfedDim.width, y - halfedDim.height, RepeatFactor, !( displayType.laterReversed && !InvertInsteadOfReverse ) ) );// */
		return ColorDecide.NextColorDecide ( VibrantColors.Black, VibrantColors.Black, pattern2D.ToFXColor(), BrowserPR.getColor( x, y ), InitialColorContrastingChoice, ColorTooSimilarReplacementColor, ColorDifference, someTargetColorHit, laterReversed == Reversed, NextStepColorTooSimilarEffect, InvertBasisFromBackground );
		//}
	}


	public Color RainbowVideoTest(double ColorsFactor, double LocationOfStillMovement, double LocationOfColorMovement, double FullSliderRunThrough, int x, int y, double RepeatFactor, double SpiralFactor, double NumberOfSpirals, double HalfSreenDiagionalLength, boolean Reversed, double BrightnessMultiplyer, int Gradations, double OpacityBefore, double OpacityAfter, boolean Adjusted, PixelReader BasisPR, PixelReader BackgroundBasisPR, PixelReader BrowserPR, Dimension Dim, String TypeOfDisplay, Color InitialColorContrastingChoice, Color ColorTooSimilarReplacementColor, double ColorDifference, boolean InvertBasisFromBackground, boolean InvertInsteadOfReverse, boolean InvertBoth, boolean InvertJustOrigional, /*boolean ReversalOfBackgroundEffectsMaster,*/ boolean NextStepColorTooSimilarEffect )
	{
		pattern2D.set( VibrantColors.HalfGrey );
		rainbowSoftColor.set( VibrantColors.HalfGrey );
		pattern2D.RainbowDoubleExponentiator( FullSliderRunThrough * - ColorsFactor / RepeatFactor, LocationOfStillMovement, LocationOfColorMovement, x, y, FullSliderRunThrough, Dim, 4., -1, displayType.laterReversed && !InvertInsteadOfReverse, BrightnessMultiplyer, Gradations, OpacityBefore, OpacityAfter, Adjusted );
		if ( ( InvertInsteadOfReverse && displayType.laterReversed != Reversed ) || InvertBoth || ( InvertJustOrigional && displayType.laterReversed == Reversed ) )
			pattern2D.set( pattern2D.ToFXColor().invert() );
		rainbowSoftColor.set( pattern2D.ToFXColor() );
		//rainbowSoftColor = new RainbowSoftColor( new double[] { 255 * fxColor.getRed(), 255 * fxColor.getGreen(), 255 * fxColor.getBlue(), fxColor.getOpacity() } );
		rgb = rainbowSoftColor.rgb;
		argb = rainbowSoftColor.argb;
		fxColor = rainbowSoftColor.ToFXColor();
		return fxColor;
	}

	/*public Color[] CustomColorsReverser ( Color[] FXcolorArray )//Reverses Custom Colors By Flipping Around Colors Like Rainbow Reversal Without Changing Any Colors Like Green In Rainbow To Pink In Reversed //
	{//!!Use ColorArrayReverser If Visual Clarity And Appeal Is Needed!!
		fxColorArray = new Color[FXcolorArray.length];
		for (int c = 0; c < FXcolorArray.length; c++)
			fxColorArray[c] = FXcolorArray[ FXcolorArray.length - c - 1 ];
		return fxColorArray;
	}// */
	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 void set(double[] ARGB) { argb = ARGB; rgb[0] = ARGB[0]; rgb[1] = ARGB[1]; rgb[2] = ARGB[2]; fxColor = Color.rgb( (int)(ColorValueFitter(ARGB[0])), (int)(ColorValueFitter(ARGB[1])), (int)(ColorValueFitter(ARGB[2])), (int)(OpacityValueFitter(ARGB[3])) ); rainbowSoftColor = new RainbowSoftColor( ARGB ); }//Assigns Colors With ARGB //29th Square In SimpleDiagnosticsClass.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 }; rainbowSoftColor = new RainbowSoftColor( argb ); }//Assigns Colors With FXColor //30th Square In SimpleDiagnosticsClass.java
	public Color get() { return fxColor; }//Returns Always Happen With Variable Output With ARGB Functionality //31st Square In SimpleDiagnosticsClass.java
}