Post by Wolf_Rainbowtail on Nov 15, 2012 18:25:20 GMT -5
Not the code. This green part up here isn't the code. But, for anyone interested in my colour blender, what follows is, well, it XD Also the lines that have // before it are comments and not technically part of the code, although they do make it tons more understandable XD
import java.util.Scanner;
/**
*
*/
/**
* @author Amber
*
*/
public class ColourBlender2 {
/**
* @param args
*/
public static void main(String[] args) {
// print out what the program is for
System.out.println("Hex colour blender :D");
// create array to hold numbers
String [] firstArray =
{"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1A", "1B", "1C", "1D", "1E", "1F",
"20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2A", "2B", "2C", "2D", "2E", "2F",
"30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3A", "3B", "3C", "3D", "3E", "3F",
"40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", "4D", "4E", "4F",
"50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "5D", "5E", "5F",
"60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F",
"70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E", "7F",
"80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8A", "8B", "8C", "8D", "8E", "8F",
"90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9A", "9B", "9C", "9D", "9E", "9F",
"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA", "AB", "AC", "AD", "AE", "AF",
"B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "BA", "BB", "BC", "BD", "BE", "BF",
"C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CA", "CB", "CC", "CD", "CE", "CF",
"D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "DA", "DB", "DC", "DD", "DE", "DF",
"E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "EA", "EB", "EC", "ED", "EE", "EF",
"F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF"};
//prompt user to enter first colour
System.out.println("Enter the first colour");
//create Scanner object
Scanner input1 = new Scanner(System.in);
//assign user input to a variable
String userInput1 = input1.next();
//prompt user to enter second colour
System.out.println("Enter the second colour");
//create Scanner object
Scanner input2 = new Scanner(System.in);
//assign user input to a variable
String userInput2 = input2.next();
//prompt user to enter how many colours they'd like
System.out.println("How many colours do you need?");
//create Scanner object
Scanner input = new Scanner(System.in);
//assign user input to a variable
int userInput3 = input.nextInt();
//create array to hold actual outcomes???
String [] outcomeArray = new String[userInput3];
//create for loop to populate outcomeArray
for(int i = 0; i < outcomeArray.length; i++)
{
//assign first character of the first colour to a variable
char charOneFirstRed;
charOneFirstRed = userInput1.charAt(0);
//create int variable to hold converted char value
int intOneFirstRed = 0;
//Convert char into number and store in Int variable
if (charOneFirstRed == '1')
{charOneFirstRed = 1;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '2')
{charOneFirstRed = 2;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '3')
{charOneFirstRed = 3;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '4')
{charOneFirstRed = 4;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '5')
{charOneFirstRed = 5;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '6')
{charOneFirstRed = 6;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '7')
{charOneFirstRed = 7;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '8')
{charOneFirstRed = 8;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '9')
{charOneFirstRed = 9;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'A')
{charOneFirstRed = 10;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'B')
{charOneFirstRed = 11;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'C')
{charOneFirstRed = 12;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'D')
{charOneFirstRed = 13;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'E')
{charOneFirstRed = 14;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'F')
{charOneFirstRed = 15;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'a')
{charOneFirstRed = 10;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'b')
{charOneFirstRed = 11;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'c')
{charOneFirstRed = 12;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'd')
{charOneFirstRed = 13;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'e')
{charOneFirstRed = 14;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'f')
{charOneFirstRed = 15;
intOneFirstRed = charOneFirstRed;}
//assign second character of the first colour to a variable
char charTwoFirstRed;
charTwoFirstRed = userInput1.charAt(1);
//create int variable to hold converted char value
int intTwoFirstRed = 0;
//Convert char into number and store in int variable
if (charTwoFirstRed == '1')
{charTwoFirstRed = 1;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '2')
{charTwoFirstRed = 2;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '3')
{charTwoFirstRed = 3;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '4')
{charTwoFirstRed = 4;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '5')
{charTwoFirstRed = 5;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '6')
{charTwoFirstRed = 6;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '7')
{charTwoFirstRed = 7;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '8')
{charTwoFirstRed = 8;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '9')
{charTwoFirstRed = 9;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'A')
{charTwoFirstRed = 10;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'B')
{charTwoFirstRed = 11;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'C')
{charTwoFirstRed = 12;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'D')
{charTwoFirstRed = 13;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'E')
{charTwoFirstRed = 14;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'F')
{charTwoFirstRed = 15;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'a')
{charTwoFirstRed = 10;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'b')
{charTwoFirstRed = 11;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'c')
{charTwoFirstRed = 12;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'd')
{charTwoFirstRed = 13;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'e')
{charTwoFirstRed = 14;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'f')
{charTwoFirstRed = 15;
intTwoFirstRed = charTwoFirstRed;}
//Multiply the first character of the first colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneFirstRed = intOneFirstRed * 16;
//Store the combined values of intOneFirstRed and intTwoFirstRed into one int variable
int redOne;
redOne = intOneFirstRed + intTwoFirstRed;
//assign first character of the second colour to a variable
char charOneSecondRed;
charOneSecondRed = userInput2.charAt(0);
//create int variable to hold converted char value
int intOneSecondRed = 0;
//Convert char into number and store in int variable
if (charOneSecondRed == '1')
{charOneSecondRed = 1;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '2')
{charOneSecondRed = 2;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '3')
{charOneSecondRed = 3;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '4')
{charOneSecondRed = 4;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '5')
{charOneSecondRed = 5;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '6')
{charOneSecondRed = 6;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '7')
{charOneSecondRed = 7;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '8')
{charOneSecondRed = 8;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '9')
{charOneSecondRed = 9;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'A')
{charOneSecondRed = 10;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'B')
{charOneSecondRed = 11;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'C')
{charOneSecondRed = 12;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'D')
{charOneSecondRed = 13;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'E')
{charOneSecondRed = 14;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'F')
{charOneSecondRed = 15;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'a')
{charOneSecondRed = 10;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'b')
{charOneSecondRed = 11;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'c')
{charOneSecondRed = 12;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'd')
{charOneSecondRed = 13;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'e')
{charOneSecondRed = 14;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'f')
{charOneSecondRed = 15;
intOneSecondRed = charOneSecondRed;}
//assign second character of the second colour to a variable
char charTwoSecondRed;
charTwoSecondRed = userInput2.charAt(1);
//create int variable to hold converted char value
int intTwoSecondRed = 0;
//Convert char into number and store in int variable
if (charTwoSecondRed == '1')
{charTwoSecondRed = 1;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '2')
{charTwoSecondRed = 2;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '3')
{charTwoSecondRed = 3;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '4')
{charTwoSecondRed = 4;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '5')
{charTwoSecondRed = 5;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '6')
{charTwoSecondRed = 6;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '7')
{charTwoSecondRed = 7;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '8')
{charTwoSecondRed = 8;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '9')
{charTwoSecondRed = 9;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'A')
{charTwoSecondRed = 10;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'B')
{charTwoSecondRed = 11;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'C')
{charTwoSecondRed = 12;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'D')
{charTwoSecondRed = 13;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'E')
{charTwoSecondRed = 14;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'F')
{charTwoSecondRed = 15;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'a')
{charTwoSecondRed = 10;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'b')
{charTwoSecondRed = 11;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'c')
{charTwoSecondRed = 12;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'd')
{charTwoSecondRed = 13;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'e')
{charTwoSecondRed = 14;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'f')
{charTwoSecondRed = 15;
intTwoSecondRed = charTwoSecondRed;}
//Multiply the first character of the second colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneSecondRed = intOneSecondRed * 16;
//Store the combined values of intOneSecondRed and intTwoSecondRed into one int variable
int redTwo;
redTwo = intOneSecondRed + intTwoSecondRed;
//If redOne's value is greater than redTwo's value, switch the value of the two variables
if (redOne > redTwo)
{
int placeholderRed = redOne;
redOne = redTwo;
redTwo = placeholderRed;
}
//Determine array size based on how many numbers are in between redOne and redTwo
int redArraySize = redTwo - redOne;
//declare redChoice
int redChoice = 0;
//declare random number up here because why not?
double randomNumberTrue = (double)(Math.random());
//if the array size is 0, do NOT create the array and have redChoice be redOne
if (redArraySize == 0)
{
redChoice = redOne;
}
//Else, create the array, etc
else
{
//Create array to hold choices
int [] redArray = new int[redArraySize];
//System.out.println("The size of redArray is " + redArraySize);
//STUB
//System.out.println("Reminder that redOne and redTwo's values are " + redOne + " and " + redTwo);
//create for loop to populate redArray
for(int i2 = 0; i2 < redArray.length; i2++)
{
redArray[i2] = redOne;
redOne++;
}//end for
double randomNumberRed = randomNumberTrue * redArray.length;
//IMPORTANT! Convert randomNumberRed to an int
int randomNumberRedGood = (int)randomNumberRed;
redChoice = redArray[randomNumberRedGood];
}//end else
//System.out.println("Value of redChoice is " + redChoice);
//System.out.println("Value of redChoice at firstArray is " + firstArray[redChoice]);
String redActual = firstArray[redChoice];
//assign third character of the first colour to a variable
char charOneFirstGreen;
charOneFirstGreen = userInput1.charAt(2);
//create int variable to hold converted char value
int intOneFirstGreen = 0;
//Convert char into number and store in Int variable
if (charOneFirstGreen == '1')
{charOneFirstGreen = 1;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '2')
{charOneFirstGreen = 2;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '3')
{charOneFirstGreen = 3;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '4')
{charOneFirstGreen = 4;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '5')
{charOneFirstGreen = 5;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '6')
{charOneFirstGreen = 6;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '7')
{charOneFirstGreen = 7;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '8')
{charOneFirstGreen = 8;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '9')
{charOneFirstGreen = 9;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'A')
{charOneFirstGreen = 10;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'B')
{charOneFirstGreen = 11;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'C')
{charOneFirstGreen = 12;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'D')
{charOneFirstGreen = 13;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'E')
{charOneFirstGreen = 14;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'F')
{charOneFirstGreen = 15;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'a')
{charOneFirstGreen = 10;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'b')
{charOneFirstGreen = 11;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'c')
{charOneFirstGreen = 12;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'd')
{charOneFirstGreen = 13;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'e')
{charOneFirstGreen = 14;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'f')
{charOneFirstGreen = 15;
intOneFirstGreen = charOneFirstGreen;}
//assign fourth character of the first colour to a variable
char charTwoFirstGreen;
charTwoFirstGreen = userInput1.charAt(3);
//create int variable to hold converted char value
int intTwoFirstGreen = 0;
//Convert char into number and store in int variable
if (charTwoFirstGreen == '1')
{charTwoFirstGreen = 1;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '2')
{charTwoFirstGreen = 2;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '3')
{charTwoFirstGreen = 3;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '4')
{charTwoFirstGreen = 4;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '5')
{charTwoFirstGreen = 5;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '6')
{charTwoFirstGreen = 6;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '7')
{charTwoFirstGreen = 7;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '8')
{charTwoFirstGreen = 8;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '9')
{charTwoFirstGreen = 9;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'A')
{charTwoFirstGreen = 10;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'B')
{charTwoFirstGreen = 11;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'C')
{charTwoFirstGreen = 12;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'D')
{charTwoFirstGreen = 13;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'E')
{charTwoFirstGreen = 14;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'F')
{charTwoFirstGreen = 15;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'a')
{charTwoFirstGreen = 10;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'b')
{charTwoFirstGreen = 11;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'c')
{charTwoFirstGreen = 12;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'd')
{charTwoFirstGreen = 13;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'e')
{charTwoFirstGreen = 14;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'f')
{charTwoFirstGreen = 15;
intTwoFirstGreen = charTwoFirstGreen;}
//Multiply the first character of the first colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneFirstGreen = intOneFirstGreen * 16;
//Store the combined values of intOneFirstGreen and intTwoFirstGreen into one int variable
int GreenOne;
GreenOne = intOneFirstGreen + intTwoFirstGreen;
//assign third character of the second colour to a variable
char charOneSecondGreen;
charOneSecondGreen = userInput2.charAt(2);
//create int variable to hold converted char value
int intOneSecondGreen = 0;
//Convert char into number and store in int variable
if (charOneSecondGreen == '1')
{charOneSecondGreen = 1;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '2')
{charOneSecondGreen = 2;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '3')
{charOneSecondGreen = 3;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '4')
{charOneSecondGreen = 4;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '5')
{charOneSecondGreen = 5;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '6')
{charOneSecondGreen = 6;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '7')
{charOneSecondGreen = 7;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '8')
{charOneSecondGreen = 8;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '9')
{charOneSecondGreen = 9;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'A')
{charOneSecondGreen = 10;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'B')
{charOneSecondGreen = 11;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'C')
{charOneSecondGreen = 12;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'D')
{charOneSecondGreen = 13;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'E')
{charOneSecondGreen = 14;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'F')
{charOneSecondGreen = 15;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'a')
{charOneSecondGreen = 10;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'b')
{charOneSecondGreen = 11;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'c')
{charOneSecondGreen = 12;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'd')
{charOneSecondGreen = 13;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'e')
{charOneSecondGreen = 14;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'f')
{charOneSecondGreen = 15;
intOneSecondGreen = charOneSecondGreen;}
//assign fourth character of the second colour to a variable
char charTwoSecondGreen;
charTwoSecondGreen = userInput2.charAt(3);
//create int variable to hold converted char value
int intTwoSecondGreen = 0;
//Convert char into number and store in int variable
if (charTwoSecondGreen == '1')
{charTwoSecondGreen = 1;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '2')
{charTwoSecondGreen = 2;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '3')
{charTwoSecondGreen = 3;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '4')
{charTwoSecondGreen = 4;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '5')
{charTwoSecondGreen = 5;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '6')
{charTwoSecondGreen = 6;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '7')
{charTwoSecondGreen = 7;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '8')
{charTwoSecondGreen = 8;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '9')
{charTwoSecondGreen = 9;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'A')
{charTwoSecondGreen = 10;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'B')
{charTwoSecondGreen = 11;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'C')
{charTwoSecondGreen = 12;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'D')
{charTwoSecondGreen = 13;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'E')
{charTwoSecondGreen = 14;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'F')
{charTwoSecondGreen = 15;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'a')
{charTwoSecondGreen = 10;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'b')
{charTwoSecondGreen = 11;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'c')
{charTwoSecondGreen = 12;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'd')
{charTwoSecondGreen = 13;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'e')
{charTwoSecondGreen = 14;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'f')
{charTwoSecondGreen = 15;
intTwoSecondGreen = charTwoSecondGreen;}
//Multiply the first character of the second colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneSecondGreen = intOneSecondGreen * 16;
//Store the combined values of intOneSecondGreen and intTwoSecondGreen into one int variable
int GreenTwo;
GreenTwo = intOneSecondGreen + intTwoSecondGreen;
//If GreenOne's value is greater than GreenTwo's value, switch the value of the two variables
if (GreenOne > GreenTwo)
{
int placeholderGreen = GreenOne;
GreenOne = GreenTwo;
GreenTwo = placeholderGreen;
}
//Determine array size based on how many numbers are in between GreenOne and GreenTwo
int GreenArraySize = GreenTwo - GreenOne;
//declare GreenChoice
int GreenChoice = 0;
//if the array size is 0, do NOT create the array and have GreenChoice be GreenOne
if (GreenArraySize == 0)
{
GreenChoice = GreenOne;
}
//Else, create the array, etc.
else
{
//Create array to hold choices
int [] GreenArray = new int[GreenArraySize];
//System.out.println("The size of GreenArray is " + GreenArraySize);
//STUB
//System.out.println("Reminder that GreenOne and GreenTwo's values are " + GreenOne + " and " + GreenTwo);
//create for loop to populate GreenArray
for(int i3 = 0; i3 < GreenArray.length; i3++)
{
GreenArray[i3] = GreenOne;
GreenOne++;
}//end for
double randomNumberGreen = randomNumberTrue * GreenArray.length;
//IMPORTANT! Convert randomNumberGreen to an int
int randomNumberGreenGood = (int)randomNumberGreen;
GreenChoice = GreenArray[randomNumberGreenGood];
}//end else
//System.out.println("Value of GreenChoice is " + GreenChoice);
//System.out.println("Value of GreenChoice at firstArray is " + firstArray[GreenChoice]);
String GreenActual = firstArray[GreenChoice];
//assign fifth character of the first colour to a variable
char charOneFirstBlue;
charOneFirstBlue = userInput1.charAt(4);
//create int variable to hold converted char value
int intOneFirstBlue = 0;
//Convert char into number and store in Int variable
if (charOneFirstBlue == '1')
{charOneFirstBlue = 1;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '2')
{charOneFirstBlue = 2;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '3')
{charOneFirstBlue = 3;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '4')
{charOneFirstBlue = 4;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '5')
{charOneFirstBlue = 5;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '6')
{charOneFirstBlue = 6;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '7')
{charOneFirstBlue = 7;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '8')
{charOneFirstBlue = 8;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '9')
{charOneFirstBlue = 9;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'A')
{charOneFirstBlue = 10;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'B')
{charOneFirstBlue = 11;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'C')
{charOneFirstBlue = 12;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'D')
{charOneFirstBlue = 13;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'E')
{charOneFirstBlue = 14;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'F')
{charOneFirstBlue = 15;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'a')
{charOneFirstBlue = 10;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'b')
{charOneFirstBlue = 11;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'c')
{charOneFirstBlue = 12;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'd')
{charOneFirstBlue = 13;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'e')
{charOneFirstBlue = 14;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'f')
{charOneFirstBlue = 15;
intOneFirstBlue = charOneFirstBlue;}
//assign sixth character of the first colour to a variable
char charTwoFirstBlue;
charTwoFirstBlue = userInput1.charAt(5);
//create int variable to hold converted char value
int intTwoFirstBlue = 0;
//Convert char into number and store in int variable
if (charTwoFirstBlue == '1')
{charTwoFirstBlue = 1;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '2')
{charTwoFirstBlue = 2;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '3')
{charTwoFirstBlue = 3;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '4')
{charTwoFirstBlue = 4;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '5')
{charTwoFirstBlue = 5;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '6')
{charTwoFirstBlue = 6;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '7')
{charTwoFirstBlue = 7;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '8')
{charTwoFirstBlue = 8;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '9')
{charTwoFirstBlue = 9;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'A')
{charTwoFirstBlue = 10;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'B')
{charTwoFirstBlue = 11;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'C')
{charTwoFirstBlue = 12;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'D')
{charTwoFirstBlue = 13;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'E')
{charTwoFirstBlue = 14;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'F')
{charTwoFirstBlue = 15;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'a')
{charTwoFirstBlue = 10;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'b')
{charTwoFirstBlue = 11;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'c')
{charTwoFirstBlue = 12;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'd')
{charTwoFirstBlue = 13;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'e')
{charTwoFirstBlue = 14;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'f')
{charTwoFirstBlue = 15;
intTwoFirstBlue = charTwoFirstBlue;}
//Multiply the first character of the first colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneFirstBlue = intOneFirstBlue * 16;
//Store the combined values of intOneFirstBlue and intTwoFirstBlue into one int variable
int BlueOne;
BlueOne = intOneFirstBlue + intTwoFirstBlue;
//assign fifth character of the second colour to a variable
char charOneSecondBlue;
charOneSecondBlue = userInput2.charAt(4);
//create int variable to hold converted char value
int intOneSecondBlue = 0;
//Convert char into number and store in int variable
if (charOneSecondBlue == '1')
{charOneSecondBlue = 1;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '2')
{charOneSecondBlue = 2;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '3')
{charOneSecondBlue = 3;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '4')
{charOneSecondBlue = 4;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '5')
{charOneSecondBlue = 5;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '6')
{charOneSecondBlue = 6;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '7')
{charOneSecondBlue = 7;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '8')
{charOneSecondBlue = 8;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '9')
{charOneSecondBlue = 9;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'A')
{charOneSecondBlue = 10;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'B')
{charOneSecondBlue = 11;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'C')
{charOneSecondBlue = 12;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'D')
{charOneSecondBlue = 13;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'E')
{charOneSecondBlue = 14;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'F')
{charOneSecondBlue = 15;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'a')
{charOneSecondBlue = 10;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'b')
{charOneSecondBlue = 11;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'c')
{charOneSecondBlue = 12;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'd')
{charOneSecondBlue = 13;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'e')
{charOneSecondBlue = 14;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'f')
{charOneSecondBlue = 15;
intOneSecondBlue = charOneSecondBlue;}
//assign sixth character of the second colour to a variable
char charTwoSecondBlue;
charTwoSecondBlue = userInput2.charAt(5);
//create int variable to hold converted char value
int intTwoSecondBlue = 0;
//Convert char into number and store in int variable
if (charTwoSecondBlue == '1')
{charTwoSecondBlue = 1;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '2')
{charTwoSecondBlue = 2;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '3')
{charTwoSecondBlue = 3;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '4')
{charTwoSecondBlue = 4;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '5')
{charTwoSecondBlue = 5;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '6')
{charTwoSecondBlue = 6;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '7')
{charTwoSecondBlue = 7;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '8')
{charTwoSecondBlue = 8;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '9')
{charTwoSecondBlue = 9;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'A')
{charTwoSecondBlue = 10;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'B')
{charTwoSecondBlue = 11;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'C')
{charTwoSecondBlue = 12;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'D')
{charTwoSecondBlue = 13;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'E')
{charTwoSecondBlue = 14;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'F')
{charTwoSecondBlue = 15;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'a')
{charTwoSecondBlue = 10;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'b')
{charTwoSecondBlue = 11;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'c')
{charTwoSecondBlue = 12;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'd')
{charTwoSecondBlue = 13;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'e')
{charTwoSecondBlue = 14;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'f')
{charTwoSecondBlue = 15;
intTwoSecondBlue = charTwoSecondBlue;}
//Multiply the first character of the second colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneSecondBlue = intOneSecondBlue * 16;
//Store the combined values of intOneSecondBlue and intTwoSecondBlue into one int variable
int BlueTwo;
BlueTwo = intOneSecondBlue + intTwoSecondBlue;
//If BlueOne's value is greater than BlueTwo's value, switch the value of the two variables
if (BlueOne > BlueTwo)
{
int placeholderBlue = BlueOne;
BlueOne = BlueTwo;
BlueTwo = placeholderBlue;
}
//Determine array size based on how many numbers are in between BlueOne and BlueTwo
int BlueArraySize = BlueTwo - BlueOne;
//declare BlueChoice
int BlueChoice = 0;
//if the array size is 0, do NOT create the array and have BlueChoice be BlueOne
if (BlueArraySize == 0)
{
BlueChoice = BlueOne;
}
//Else, create the array, etc.
else
{
//Create array to hold choices
int [] BlueArray = new int[BlueArraySize];
//System.out.println("The size of BlueArray is " + BlueArraySize);
//STUB
//System.out.println("Reminder that BlueOne and BlueTwo's values are " + BlueOne + " and " + BlueTwo);
//create for loop to populate BlueArray
for(int i4 = 0; i4 < BlueArray.length; i4++)
{
BlueArray[i4] = BlueOne;
BlueOne++;
}//end for
double randomNumberBlue = randomNumberTrue * BlueArray.length;
//IMPORTANT! Convert randomNumberBlue to an int
int randomNumberBlueGood = (int)randomNumberBlue;
BlueChoice = BlueArray[randomNumberBlueGood];
}//end else
//System.out.println("Value of BlueChoice is " + BlueChoice);
//System.out.println("Value of BlueChoice at firstArray is " + firstArray[BlueChoice]);
String BlueActual = firstArray[BlueChoice];
String actualColour = redActual + GreenActual + BlueActual;
outcomeArray = actualColour;
}//end for
System.out.println("Here you go ^.^");
System.out.println();//for spacing purposes
//create for loop to print out results
for(int i = 0; i < outcomeArray.length; i++)
{
System.out.println(outcomeArray);
}
}
}
Also not the code. This is just a sample output from the program. What do you think? *Tail wag*
Hex colour blender :D
Enter the first colour
000000
Enter the second colour
ffffff
How many colours do you need?
5
Here you go ^.^
747474
050505
DEDEDE
BBBBBB
414141
import java.util.Scanner;
/**
*
*/
/**
* @author Amber
*
*/
public class ColourBlender2 {
/**
* @param args
*/
public static void main(String[] args) {
// print out what the program is for
System.out.println("Hex colour blender :D");
// create array to hold numbers
String [] firstArray =
{"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1A", "1B", "1C", "1D", "1E", "1F",
"20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2A", "2B", "2C", "2D", "2E", "2F",
"30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3A", "3B", "3C", "3D", "3E", "3F",
"40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", "4D", "4E", "4F",
"50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "5D", "5E", "5F",
"60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F",
"70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E", "7F",
"80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8A", "8B", "8C", "8D", "8E", "8F",
"90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9A", "9B", "9C", "9D", "9E", "9F",
"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA", "AB", "AC", "AD", "AE", "AF",
"B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "BA", "BB", "BC", "BD", "BE", "BF",
"C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CA", "CB", "CC", "CD", "CE", "CF",
"D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "DA", "DB", "DC", "DD", "DE", "DF",
"E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "EA", "EB", "EC", "ED", "EE", "EF",
"F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF"};
//prompt user to enter first colour
System.out.println("Enter the first colour");
//create Scanner object
Scanner input1 = new Scanner(System.in);
//assign user input to a variable
String userInput1 = input1.next();
//prompt user to enter second colour
System.out.println("Enter the second colour");
//create Scanner object
Scanner input2 = new Scanner(System.in);
//assign user input to a variable
String userInput2 = input2.next();
//prompt user to enter how many colours they'd like
System.out.println("How many colours do you need?");
//create Scanner object
Scanner input = new Scanner(System.in);
//assign user input to a variable
int userInput3 = input.nextInt();
//create array to hold actual outcomes???
String [] outcomeArray = new String[userInput3];
//create for loop to populate outcomeArray
for(int i = 0; i < outcomeArray.length; i++)
{
//assign first character of the first colour to a variable
char charOneFirstRed;
charOneFirstRed = userInput1.charAt(0);
//create int variable to hold converted char value
int intOneFirstRed = 0;
//Convert char into number and store in Int variable
if (charOneFirstRed == '1')
{charOneFirstRed = 1;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '2')
{charOneFirstRed = 2;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '3')
{charOneFirstRed = 3;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '4')
{charOneFirstRed = 4;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '5')
{charOneFirstRed = 5;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '6')
{charOneFirstRed = 6;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '7')
{charOneFirstRed = 7;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '8')
{charOneFirstRed = 8;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == '9')
{charOneFirstRed = 9;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'A')
{charOneFirstRed = 10;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'B')
{charOneFirstRed = 11;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'C')
{charOneFirstRed = 12;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'D')
{charOneFirstRed = 13;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'E')
{charOneFirstRed = 14;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'F')
{charOneFirstRed = 15;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'a')
{charOneFirstRed = 10;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'b')
{charOneFirstRed = 11;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'c')
{charOneFirstRed = 12;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'd')
{charOneFirstRed = 13;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'e')
{charOneFirstRed = 14;
intOneFirstRed = charOneFirstRed;}
if (charOneFirstRed == 'f')
{charOneFirstRed = 15;
intOneFirstRed = charOneFirstRed;}
//assign second character of the first colour to a variable
char charTwoFirstRed;
charTwoFirstRed = userInput1.charAt(1);
//create int variable to hold converted char value
int intTwoFirstRed = 0;
//Convert char into number and store in int variable
if (charTwoFirstRed == '1')
{charTwoFirstRed = 1;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '2')
{charTwoFirstRed = 2;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '3')
{charTwoFirstRed = 3;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '4')
{charTwoFirstRed = 4;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '5')
{charTwoFirstRed = 5;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '6')
{charTwoFirstRed = 6;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '7')
{charTwoFirstRed = 7;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '8')
{charTwoFirstRed = 8;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == '9')
{charTwoFirstRed = 9;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'A')
{charTwoFirstRed = 10;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'B')
{charTwoFirstRed = 11;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'C')
{charTwoFirstRed = 12;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'D')
{charTwoFirstRed = 13;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'E')
{charTwoFirstRed = 14;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'F')
{charTwoFirstRed = 15;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'a')
{charTwoFirstRed = 10;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'b')
{charTwoFirstRed = 11;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'c')
{charTwoFirstRed = 12;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'd')
{charTwoFirstRed = 13;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'e')
{charTwoFirstRed = 14;
intTwoFirstRed = charTwoFirstRed;}
if (charTwoFirstRed == 'f')
{charTwoFirstRed = 15;
intTwoFirstRed = charTwoFirstRed;}
//Multiply the first character of the first colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneFirstRed = intOneFirstRed * 16;
//Store the combined values of intOneFirstRed and intTwoFirstRed into one int variable
int redOne;
redOne = intOneFirstRed + intTwoFirstRed;
//assign first character of the second colour to a variable
char charOneSecondRed;
charOneSecondRed = userInput2.charAt(0);
//create int variable to hold converted char value
int intOneSecondRed = 0;
//Convert char into number and store in int variable
if (charOneSecondRed == '1')
{charOneSecondRed = 1;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '2')
{charOneSecondRed = 2;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '3')
{charOneSecondRed = 3;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '4')
{charOneSecondRed = 4;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '5')
{charOneSecondRed = 5;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '6')
{charOneSecondRed = 6;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '7')
{charOneSecondRed = 7;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '8')
{charOneSecondRed = 8;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == '9')
{charOneSecondRed = 9;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'A')
{charOneSecondRed = 10;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'B')
{charOneSecondRed = 11;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'C')
{charOneSecondRed = 12;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'D')
{charOneSecondRed = 13;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'E')
{charOneSecondRed = 14;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'F')
{charOneSecondRed = 15;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'a')
{charOneSecondRed = 10;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'b')
{charOneSecondRed = 11;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'c')
{charOneSecondRed = 12;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'd')
{charOneSecondRed = 13;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'e')
{charOneSecondRed = 14;
intOneSecondRed = charOneSecondRed;}
if (charOneSecondRed == 'f')
{charOneSecondRed = 15;
intOneSecondRed = charOneSecondRed;}
//assign second character of the second colour to a variable
char charTwoSecondRed;
charTwoSecondRed = userInput2.charAt(1);
//create int variable to hold converted char value
int intTwoSecondRed = 0;
//Convert char into number and store in int variable
if (charTwoSecondRed == '1')
{charTwoSecondRed = 1;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '2')
{charTwoSecondRed = 2;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '3')
{charTwoSecondRed = 3;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '4')
{charTwoSecondRed = 4;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '5')
{charTwoSecondRed = 5;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '6')
{charTwoSecondRed = 6;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '7')
{charTwoSecondRed = 7;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '8')
{charTwoSecondRed = 8;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == '9')
{charTwoSecondRed = 9;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'A')
{charTwoSecondRed = 10;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'B')
{charTwoSecondRed = 11;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'C')
{charTwoSecondRed = 12;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'D')
{charTwoSecondRed = 13;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'E')
{charTwoSecondRed = 14;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'F')
{charTwoSecondRed = 15;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'a')
{charTwoSecondRed = 10;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'b')
{charTwoSecondRed = 11;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'c')
{charTwoSecondRed = 12;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'd')
{charTwoSecondRed = 13;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'e')
{charTwoSecondRed = 14;
intTwoSecondRed = charTwoSecondRed;}
if (charTwoSecondRed == 'f')
{charTwoSecondRed = 15;
intTwoSecondRed = charTwoSecondRed;}
//Multiply the first character of the second colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneSecondRed = intOneSecondRed * 16;
//Store the combined values of intOneSecondRed and intTwoSecondRed into one int variable
int redTwo;
redTwo = intOneSecondRed + intTwoSecondRed;
//If redOne's value is greater than redTwo's value, switch the value of the two variables
if (redOne > redTwo)
{
int placeholderRed = redOne;
redOne = redTwo;
redTwo = placeholderRed;
}
//Determine array size based on how many numbers are in between redOne and redTwo
int redArraySize = redTwo - redOne;
//declare redChoice
int redChoice = 0;
//declare random number up here because why not?
double randomNumberTrue = (double)(Math.random());
//if the array size is 0, do NOT create the array and have redChoice be redOne
if (redArraySize == 0)
{
redChoice = redOne;
}
//Else, create the array, etc
else
{
//Create array to hold choices
int [] redArray = new int[redArraySize];
//System.out.println("The size of redArray is " + redArraySize);
//STUB
//System.out.println("Reminder that redOne and redTwo's values are " + redOne + " and " + redTwo);
//create for loop to populate redArray
for(int i2 = 0; i2 < redArray.length; i2++)
{
redArray[i2] = redOne;
redOne++;
}//end for
double randomNumberRed = randomNumberTrue * redArray.length;
//IMPORTANT! Convert randomNumberRed to an int
int randomNumberRedGood = (int)randomNumberRed;
redChoice = redArray[randomNumberRedGood];
}//end else
//System.out.println("Value of redChoice is " + redChoice);
//System.out.println("Value of redChoice at firstArray is " + firstArray[redChoice]);
String redActual = firstArray[redChoice];
//assign third character of the first colour to a variable
char charOneFirstGreen;
charOneFirstGreen = userInput1.charAt(2);
//create int variable to hold converted char value
int intOneFirstGreen = 0;
//Convert char into number and store in Int variable
if (charOneFirstGreen == '1')
{charOneFirstGreen = 1;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '2')
{charOneFirstGreen = 2;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '3')
{charOneFirstGreen = 3;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '4')
{charOneFirstGreen = 4;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '5')
{charOneFirstGreen = 5;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '6')
{charOneFirstGreen = 6;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '7')
{charOneFirstGreen = 7;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '8')
{charOneFirstGreen = 8;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == '9')
{charOneFirstGreen = 9;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'A')
{charOneFirstGreen = 10;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'B')
{charOneFirstGreen = 11;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'C')
{charOneFirstGreen = 12;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'D')
{charOneFirstGreen = 13;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'E')
{charOneFirstGreen = 14;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'F')
{charOneFirstGreen = 15;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'a')
{charOneFirstGreen = 10;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'b')
{charOneFirstGreen = 11;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'c')
{charOneFirstGreen = 12;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'd')
{charOneFirstGreen = 13;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'e')
{charOneFirstGreen = 14;
intOneFirstGreen = charOneFirstGreen;}
if (charOneFirstGreen == 'f')
{charOneFirstGreen = 15;
intOneFirstGreen = charOneFirstGreen;}
//assign fourth character of the first colour to a variable
char charTwoFirstGreen;
charTwoFirstGreen = userInput1.charAt(3);
//create int variable to hold converted char value
int intTwoFirstGreen = 0;
//Convert char into number and store in int variable
if (charTwoFirstGreen == '1')
{charTwoFirstGreen = 1;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '2')
{charTwoFirstGreen = 2;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '3')
{charTwoFirstGreen = 3;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '4')
{charTwoFirstGreen = 4;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '5')
{charTwoFirstGreen = 5;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '6')
{charTwoFirstGreen = 6;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '7')
{charTwoFirstGreen = 7;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '8')
{charTwoFirstGreen = 8;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == '9')
{charTwoFirstGreen = 9;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'A')
{charTwoFirstGreen = 10;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'B')
{charTwoFirstGreen = 11;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'C')
{charTwoFirstGreen = 12;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'D')
{charTwoFirstGreen = 13;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'E')
{charTwoFirstGreen = 14;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'F')
{charTwoFirstGreen = 15;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'a')
{charTwoFirstGreen = 10;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'b')
{charTwoFirstGreen = 11;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'c')
{charTwoFirstGreen = 12;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'd')
{charTwoFirstGreen = 13;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'e')
{charTwoFirstGreen = 14;
intTwoFirstGreen = charTwoFirstGreen;}
if (charTwoFirstGreen == 'f')
{charTwoFirstGreen = 15;
intTwoFirstGreen = charTwoFirstGreen;}
//Multiply the first character of the first colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneFirstGreen = intOneFirstGreen * 16;
//Store the combined values of intOneFirstGreen and intTwoFirstGreen into one int variable
int GreenOne;
GreenOne = intOneFirstGreen + intTwoFirstGreen;
//assign third character of the second colour to a variable
char charOneSecondGreen;
charOneSecondGreen = userInput2.charAt(2);
//create int variable to hold converted char value
int intOneSecondGreen = 0;
//Convert char into number and store in int variable
if (charOneSecondGreen == '1')
{charOneSecondGreen = 1;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '2')
{charOneSecondGreen = 2;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '3')
{charOneSecondGreen = 3;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '4')
{charOneSecondGreen = 4;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '5')
{charOneSecondGreen = 5;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '6')
{charOneSecondGreen = 6;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '7')
{charOneSecondGreen = 7;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '8')
{charOneSecondGreen = 8;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == '9')
{charOneSecondGreen = 9;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'A')
{charOneSecondGreen = 10;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'B')
{charOneSecondGreen = 11;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'C')
{charOneSecondGreen = 12;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'D')
{charOneSecondGreen = 13;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'E')
{charOneSecondGreen = 14;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'F')
{charOneSecondGreen = 15;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'a')
{charOneSecondGreen = 10;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'b')
{charOneSecondGreen = 11;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'c')
{charOneSecondGreen = 12;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'd')
{charOneSecondGreen = 13;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'e')
{charOneSecondGreen = 14;
intOneSecondGreen = charOneSecondGreen;}
if (charOneSecondGreen == 'f')
{charOneSecondGreen = 15;
intOneSecondGreen = charOneSecondGreen;}
//assign fourth character of the second colour to a variable
char charTwoSecondGreen;
charTwoSecondGreen = userInput2.charAt(3);
//create int variable to hold converted char value
int intTwoSecondGreen = 0;
//Convert char into number and store in int variable
if (charTwoSecondGreen == '1')
{charTwoSecondGreen = 1;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '2')
{charTwoSecondGreen = 2;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '3')
{charTwoSecondGreen = 3;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '4')
{charTwoSecondGreen = 4;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '5')
{charTwoSecondGreen = 5;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '6')
{charTwoSecondGreen = 6;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '7')
{charTwoSecondGreen = 7;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '8')
{charTwoSecondGreen = 8;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == '9')
{charTwoSecondGreen = 9;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'A')
{charTwoSecondGreen = 10;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'B')
{charTwoSecondGreen = 11;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'C')
{charTwoSecondGreen = 12;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'D')
{charTwoSecondGreen = 13;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'E')
{charTwoSecondGreen = 14;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'F')
{charTwoSecondGreen = 15;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'a')
{charTwoSecondGreen = 10;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'b')
{charTwoSecondGreen = 11;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'c')
{charTwoSecondGreen = 12;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'd')
{charTwoSecondGreen = 13;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'e')
{charTwoSecondGreen = 14;
intTwoSecondGreen = charTwoSecondGreen;}
if (charTwoSecondGreen == 'f')
{charTwoSecondGreen = 15;
intTwoSecondGreen = charTwoSecondGreen;}
//Multiply the first character of the second colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneSecondGreen = intOneSecondGreen * 16;
//Store the combined values of intOneSecondGreen and intTwoSecondGreen into one int variable
int GreenTwo;
GreenTwo = intOneSecondGreen + intTwoSecondGreen;
//If GreenOne's value is greater than GreenTwo's value, switch the value of the two variables
if (GreenOne > GreenTwo)
{
int placeholderGreen = GreenOne;
GreenOne = GreenTwo;
GreenTwo = placeholderGreen;
}
//Determine array size based on how many numbers are in between GreenOne and GreenTwo
int GreenArraySize = GreenTwo - GreenOne;
//declare GreenChoice
int GreenChoice = 0;
//if the array size is 0, do NOT create the array and have GreenChoice be GreenOne
if (GreenArraySize == 0)
{
GreenChoice = GreenOne;
}
//Else, create the array, etc.
else
{
//Create array to hold choices
int [] GreenArray = new int[GreenArraySize];
//System.out.println("The size of GreenArray is " + GreenArraySize);
//STUB
//System.out.println("Reminder that GreenOne and GreenTwo's values are " + GreenOne + " and " + GreenTwo);
//create for loop to populate GreenArray
for(int i3 = 0; i3 < GreenArray.length; i3++)
{
GreenArray[i3] = GreenOne;
GreenOne++;
}//end for
double randomNumberGreen = randomNumberTrue * GreenArray.length;
//IMPORTANT! Convert randomNumberGreen to an int
int randomNumberGreenGood = (int)randomNumberGreen;
GreenChoice = GreenArray[randomNumberGreenGood];
}//end else
//System.out.println("Value of GreenChoice is " + GreenChoice);
//System.out.println("Value of GreenChoice at firstArray is " + firstArray[GreenChoice]);
String GreenActual = firstArray[GreenChoice];
//assign fifth character of the first colour to a variable
char charOneFirstBlue;
charOneFirstBlue = userInput1.charAt(4);
//create int variable to hold converted char value
int intOneFirstBlue = 0;
//Convert char into number and store in Int variable
if (charOneFirstBlue == '1')
{charOneFirstBlue = 1;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '2')
{charOneFirstBlue = 2;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '3')
{charOneFirstBlue = 3;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '4')
{charOneFirstBlue = 4;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '5')
{charOneFirstBlue = 5;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '6')
{charOneFirstBlue = 6;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '7')
{charOneFirstBlue = 7;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '8')
{charOneFirstBlue = 8;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == '9')
{charOneFirstBlue = 9;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'A')
{charOneFirstBlue = 10;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'B')
{charOneFirstBlue = 11;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'C')
{charOneFirstBlue = 12;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'D')
{charOneFirstBlue = 13;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'E')
{charOneFirstBlue = 14;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'F')
{charOneFirstBlue = 15;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'a')
{charOneFirstBlue = 10;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'b')
{charOneFirstBlue = 11;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'c')
{charOneFirstBlue = 12;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'd')
{charOneFirstBlue = 13;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'e')
{charOneFirstBlue = 14;
intOneFirstBlue = charOneFirstBlue;}
if (charOneFirstBlue == 'f')
{charOneFirstBlue = 15;
intOneFirstBlue = charOneFirstBlue;}
//assign sixth character of the first colour to a variable
char charTwoFirstBlue;
charTwoFirstBlue = userInput1.charAt(5);
//create int variable to hold converted char value
int intTwoFirstBlue = 0;
//Convert char into number and store in int variable
if (charTwoFirstBlue == '1')
{charTwoFirstBlue = 1;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '2')
{charTwoFirstBlue = 2;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '3')
{charTwoFirstBlue = 3;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '4')
{charTwoFirstBlue = 4;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '5')
{charTwoFirstBlue = 5;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '6')
{charTwoFirstBlue = 6;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '7')
{charTwoFirstBlue = 7;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '8')
{charTwoFirstBlue = 8;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == '9')
{charTwoFirstBlue = 9;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'A')
{charTwoFirstBlue = 10;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'B')
{charTwoFirstBlue = 11;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'C')
{charTwoFirstBlue = 12;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'D')
{charTwoFirstBlue = 13;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'E')
{charTwoFirstBlue = 14;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'F')
{charTwoFirstBlue = 15;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'a')
{charTwoFirstBlue = 10;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'b')
{charTwoFirstBlue = 11;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'c')
{charTwoFirstBlue = 12;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'd')
{charTwoFirstBlue = 13;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'e')
{charTwoFirstBlue = 14;
intTwoFirstBlue = charTwoFirstBlue;}
if (charTwoFirstBlue == 'f')
{charTwoFirstBlue = 15;
intTwoFirstBlue = charTwoFirstBlue;}
//Multiply the first character of the first colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneFirstBlue = intOneFirstBlue * 16;
//Store the combined values of intOneFirstBlue and intTwoFirstBlue into one int variable
int BlueOne;
BlueOne = intOneFirstBlue + intTwoFirstBlue;
//assign fifth character of the second colour to a variable
char charOneSecondBlue;
charOneSecondBlue = userInput2.charAt(4);
//create int variable to hold converted char value
int intOneSecondBlue = 0;
//Convert char into number and store in int variable
if (charOneSecondBlue == '1')
{charOneSecondBlue = 1;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '2')
{charOneSecondBlue = 2;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '3')
{charOneSecondBlue = 3;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '4')
{charOneSecondBlue = 4;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '5')
{charOneSecondBlue = 5;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '6')
{charOneSecondBlue = 6;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '7')
{charOneSecondBlue = 7;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '8')
{charOneSecondBlue = 8;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == '9')
{charOneSecondBlue = 9;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'A')
{charOneSecondBlue = 10;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'B')
{charOneSecondBlue = 11;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'C')
{charOneSecondBlue = 12;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'D')
{charOneSecondBlue = 13;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'E')
{charOneSecondBlue = 14;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'F')
{charOneSecondBlue = 15;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'a')
{charOneSecondBlue = 10;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'b')
{charOneSecondBlue = 11;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'c')
{charOneSecondBlue = 12;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'd')
{charOneSecondBlue = 13;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'e')
{charOneSecondBlue = 14;
intOneSecondBlue = charOneSecondBlue;}
if (charOneSecondBlue == 'f')
{charOneSecondBlue = 15;
intOneSecondBlue = charOneSecondBlue;}
//assign sixth character of the second colour to a variable
char charTwoSecondBlue;
charTwoSecondBlue = userInput2.charAt(5);
//create int variable to hold converted char value
int intTwoSecondBlue = 0;
//Convert char into number and store in int variable
if (charTwoSecondBlue == '1')
{charTwoSecondBlue = 1;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '2')
{charTwoSecondBlue = 2;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '3')
{charTwoSecondBlue = 3;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '4')
{charTwoSecondBlue = 4;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '5')
{charTwoSecondBlue = 5;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '6')
{charTwoSecondBlue = 6;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '7')
{charTwoSecondBlue = 7;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '8')
{charTwoSecondBlue = 8;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == '9')
{charTwoSecondBlue = 9;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'A')
{charTwoSecondBlue = 10;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'B')
{charTwoSecondBlue = 11;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'C')
{charTwoSecondBlue = 12;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'D')
{charTwoSecondBlue = 13;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'E')
{charTwoSecondBlue = 14;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'F')
{charTwoSecondBlue = 15;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'a')
{charTwoSecondBlue = 10;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'b')
{charTwoSecondBlue = 11;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'c')
{charTwoSecondBlue = 12;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'd')
{charTwoSecondBlue = 13;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'e')
{charTwoSecondBlue = 14;
intTwoSecondBlue = charTwoSecondBlue;}
if (charTwoSecondBlue == 'f')
{charTwoSecondBlue = 15;
intTwoSecondBlue = charTwoSecondBlue;}
//Multiply the first character of the second colour by 16 to get it out of base 16
//do NOT multiply the second character
intOneSecondBlue = intOneSecondBlue * 16;
//Store the combined values of intOneSecondBlue and intTwoSecondBlue into one int variable
int BlueTwo;
BlueTwo = intOneSecondBlue + intTwoSecondBlue;
//If BlueOne's value is greater than BlueTwo's value, switch the value of the two variables
if (BlueOne > BlueTwo)
{
int placeholderBlue = BlueOne;
BlueOne = BlueTwo;
BlueTwo = placeholderBlue;
}
//Determine array size based on how many numbers are in between BlueOne and BlueTwo
int BlueArraySize = BlueTwo - BlueOne;
//declare BlueChoice
int BlueChoice = 0;
//if the array size is 0, do NOT create the array and have BlueChoice be BlueOne
if (BlueArraySize == 0)
{
BlueChoice = BlueOne;
}
//Else, create the array, etc.
else
{
//Create array to hold choices
int [] BlueArray = new int[BlueArraySize];
//System.out.println("The size of BlueArray is " + BlueArraySize);
//STUB
//System.out.println("Reminder that BlueOne and BlueTwo's values are " + BlueOne + " and " + BlueTwo);
//create for loop to populate BlueArray
for(int i4 = 0; i4 < BlueArray.length; i4++)
{
BlueArray[i4] = BlueOne;
BlueOne++;
}//end for
double randomNumberBlue = randomNumberTrue * BlueArray.length;
//IMPORTANT! Convert randomNumberBlue to an int
int randomNumberBlueGood = (int)randomNumberBlue;
BlueChoice = BlueArray[randomNumberBlueGood];
}//end else
//System.out.println("Value of BlueChoice is " + BlueChoice);
//System.out.println("Value of BlueChoice at firstArray is " + firstArray[BlueChoice]);
String BlueActual = firstArray[BlueChoice];
String actualColour = redActual + GreenActual + BlueActual;
outcomeArray = actualColour;
}//end for
System.out.println("Here you go ^.^");
System.out.println();//for spacing purposes
//create for loop to print out results
for(int i = 0; i < outcomeArray.length; i++)
{
System.out.println(outcomeArray);
}
}
}
Also not the code. This is just a sample output from the program. What do you think? *Tail wag*
Hex colour blender :D
Enter the first colour
000000
Enter the second colour
ffffff
How many colours do you need?
5
Here you go ^.^
747474
050505
DEDEDE
BBBBBB
414141