Thanks for the response Sam! There's a small issue with the implementation though.
The updated code for reference:
if ((value.Length > 0) && (value == '#'))
start = 1;
int max = Math.Min(value.Length - start, start + 8); // We consider only the first eight characters significant.
for (int i = start; i < max; ++i)
// Always increase the color, even if the char isn't a valid number
converted <<= 4; // Move along one hex - 2^4
converted += ParseHexChar(value, i);
When you take the min value of length-start and start + 8, length (9) minus start (1) is 8, and the for loop index stops after 7 characters (1 through 8). The "max" should always be start + 8, or at most "length". I would suggest:
int max = Math.Min(value.Length, start+8);
Thank you for your help!