Hex for adafruit GFX Library & Coding for color selection

Hello. Why am I seeing 0x07E0 as lime green rather than 00FF00 as usual? Is there a table that has the values that adafruit GFX library is using instead?

void setup() {

    Serial.begin(115200);

    String hexstring = "B787B7";
    long number = (long) strtol( &hexstring[1], NULL, 16);
    int r = number >> 16;
    int g = number >> 8 & 0xFF;
    int b = number & 0xFF;

    Serial.print("red is ");
    Serial.println(r);
    Serial.print("green is ");
    Serial.println(g);
    Serial.print("blue is ");
    Serial.println(b);

}

void loop() {

}

How can this be modified for hex numbers in the form of 0x07E0 ?

  long number = (long) strtol( &hexstring[1], NULL, 16);

Why do you feel in necessary to cast a long to a long?

How can this be modified for hex numbers in the form of 0x07E0 ?

Why are you using Strings? Why do the Strings start with B? The value is NOT binary.

What does strtol() return for that string? What ends up in r, g, and b?