Actually, it's probably easier to start with the most significant character.
I can't take credit for this function, but here's what I use:
void setup() {
Serial.begin(115200);
char hx[] = {"FF00FF"};
long rgb = 0;
for (int i= 0; i < strlen(hx); i++) {
rgb = (rgb * 16) + x2b(hx[i]);
}
Serial.println(rgb);
}
void loop() {
}
byte x2b( char c) {
if (isdigit(c)) { // 0 - 9
return c - '0';
}
else if (isxdigit(c)) { // A-F, a-f
return (c & 0xF) + 9;
}
}