I am creating an image format called DIF (Dictionary Image Format), in which the image specifies the color palette (dictionary) within the image, or can choose to load an external one.
I am trying to create a color dictionary for all the possible values in the RGB spectrum. I have found how to iterate through the RGB spectrum, but am at a loss on how to iterate through all the possible dictionary keys.
Each dictionary key will be made of of a string of upper or lower case letters (like aAaAB) that is five letters long. This provides for 380204032 possible combinations, enough to encode the 16.7 million colors in RGB.
How would this work, and how would I integrate it with my existing RGB code, which is below:
Dictionary<string,Color> rgb = new Dictionary<string,Color>();
for(int r = 0; r <= 255; r++)
{
for(int g = 0; g <= 255; g++)
{
for(int b = 0; b <= 255; b++)
{
//Add colors to dictionary here
}
}
}