procedure ExtractRGB(const Color: Graphics.TColor; out Red, Green, Blue: Byte); var RGB: Windows.TColorRef; // RGB equivalent of given Colour begin RGB := Graphics.ColorToRGB(Color); // ensures system Colours are converted Red := Windows.GetRValue(RGB); Green := Windows.GetGValue(RGB); Blue := Windows.GetBValue(RGB); end;
(TColor)
ColorToRGB
ColorToString
StringToColor
ColorToIdent
IdentToColor
ColorToWebColorName
ColorToWebColorStr
WebColorNameToColor
WebColorStrToColor
WebColorToRGB
RGBToWebColorStr
RGBToWebColorName
Form1->Color = (StrToInt(RedEdit->Text) << 16) + (StrToInt(GreenEdit->Text) << 8) + (StrToInt(BlueEdit->Text)); #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
RGB不是一个函数,只是一个宏定义