I would recommend implementing a compareTo() method that determines which color comes before which.
Something like:
/**
* Blue comes before green.
*
* Returns less than 0 if item1 comes before item2
* Returns 0 if item1 comes at the same place as item2
* Returns greater than 0 if item1 comes after item2
*/
public static int compareTo(ColorItem item1, ColorItem item2)
{
int val1 = 0;
int val2 = 0;
if(item1 == BLUE)
{
val1 = 1;
}
else
{
val1 = 2;
}
if(item2 == BLUE)
{
val2 = 1;
}
else
{
val2 = 2;
}
return val1 - val2;
}
Then, somewhere in your code implement a standard sorting algorithm (say, selection sort because it's very easy).