Search code examples
delphicolorsdelphi-7

Custom Delphi Colours


If i want to set a colour property to something thats non-standard (i.e. not something like clBlack or clRed) how can i do this? Can i set something like hexadecimal colours?


Solution

  • RGB in Windows.pas

    function RGB(r, g, b: Byte): COLORREF;
    

    you can cast the result to be a TColor.

    e.g

    MyColour := TColor(RGB(Red,Green,Blue));