String[] rgb = new String[3];
rgb[0] = Integer.toHexString(color.getRed());
rgb[1] = Integer.toHexString(color.getGreen());
rgb[2] = Integer.toHexString(color.getBlue());
for(String el : rgb)
{
if(el.equals("0"))
{
el = "00";
}
}
for(int i = 0; i<3; i++)
{
if(rgb[i].equals("0"))
{
rgb[i] = "00";
}
}
In the above code I evaluate each index based on weather or not each is = to zero. yet it always runs false in the foreach loop and true when appropriate in the for loop. can someone explain what is happening behind the scenes to make this happen?
i am not running them sequentially they are both there for demo purposes.