Q:

Why does TPanel's color property display the wrong color when using a hex color value?

I am using Delphi 2010 and if I create a new VCL application, drop a TPanel on the form and set its "color" property to "clInactiveCaptionText" it shows the correct color.
Correct color:

However, if I enter the hex value for this color ($00434E54 --- R 67,G 78,B 84) it shows up incorrectly. I should note that the result is the same whether I enable runtime themes or not.
Wrong color:

Any idea on why it won't correctly show this color when specifying its hex value?

A:

RGB color values are actually specified as BGR.
So if you want:

red you need to specify $000000FF
green you need to specify $0000FF00
blue you need to specify $00FF0000

A:

As others have indicated, the RGB values are stored internally as BGR (i.e. TColor value, or what Windows calls a COLORREF), that's why when you specify a custom color code you obtain a different color.
To maintain your sanity when specifying colors in RGB form you can use the RGB() function from  the Windows unit; this accepts parameters in the "natural"/intuitive RGB order (as byte values) and yields an appropriate TColor / COLORREF value:
  MyPanel.Color := RGB(67, 78, 84);

or if hex is easier:
  MyPanel.Color := RGB($43, $4E, $54);

A:

This is because you are setting a TColor value in a RGB format you must use BGR instead.

