Fastest way to send serial commands and do something
Simple answer: don't. 

Don't even consider strings in any form. Instead you want a state machine.

In pseudocode:


Start with an invalid count number (-1)
Read a character.
If that character is x then set your counter to 0.
Otherwise, if counter is 0 or more, convert the character to a number and place it into the right byte depending on the value of your counter
Increment counter
If counter is 6 then set your LED colours and set the counter to "invalid".
Return to start.


Or, in untested C:

static int8_t counter = -1;
static uint8_t r = 0;
static uint8_t g = 0;
static uint8_t b = 0;

if (Serial.available()) {
    char c = Serial.read();
    if (c == 'x') {
        counter = 0;
    } else {
        if (c &gt; 0x39) c -= 7;
        uint8_t v = c &amp; 0x0f;
        switch (counter) {
            case 0: r = v &lt;&lt; 4; break;
            case 1: r |= v;
            case 2: g = v &lt;&lt; 4; break;
            case 3: g |= v;
            case 4: b = v &lt;&lt; 4; break;
            case 5: b |= v;
        }
        counter++;
        if (counter == 6) {
            counter = -1;
            analogWrite(3, r);
            analogWrite(5, g);
            analogWrite(6, b);
        }
    }
}


The "clever" bit that may confuse you is:

if (c &gt; 0x39) c -= 7;
uint8_t v = c &amp; 0x0f;


That is, if the character is greater than a "9" (character 0x39) then it should be a-f. Subtracting 7 from it converts ASCII HEX from 0123456789ABCDEF to 0123456789:;&lt;=&gt;?.  If you then mask it with 0x0F you end up with a number between 0 and 15, or 0-F in hex.

The rest just takes each nibble and places it into the right half of the right colour variable.