Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 879
chendriksen Avatar asked Mar 18 '10 15:03

chendriksen


People also ask

What color is Delphi?

The hexadecimal color code #d3b176 is a medium light shade of brown. In the RGB color model #d3b176 is comprised of 82.75% red, 69.41% green and 46.27% blue. In the HSL color space #d3b176 has a hue of 38° (degrees), 51% saturation and 65% lightness.


1 Answers

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));
like image 177
James Barrass Avatar answered Sep 23 '22 04:09

James Barrass