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不是一个函数,只是一个宏定义
posted on 2015-09-02 15:34  lypzxy  阅读(445)  评论(0编辑  收藏  举报