--- ---
Untested:
function Swap32(aLong: Longint): Longint; assembler; asm BSWAP eax end; function HexColorToColor(HexColor: string): TColor; {input: '#FFF8DC' -> output $DCF8FF as TColor, use IntTohex to convert output to string again if needed} begin Assert(Length(hexcolor)) > 1); Assert(hexcolor[1] = '#'); hexcolor[1] := '$'; Result := Swap32(StrToInt(hexcolor)); end;