how can i create range of color ? lazarus / 39-Graphics ---------------------------------------------------------------------- majid.ebru · 2017-09-22 14:46 Hi how can i create range of color (like blue or red or ....)? ---------------------------------------------------------------------- howardpc · 2017-09-22 15:45 One way is some variation on this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TTestMultiDialogForm.FormPaint(Sender: TObject);var  r: TRect;begin  r:=ClientRect;  r.Top:=r.CenterPoint.x;  Canvas.GradientFill(r, clNavy, clSkyBlue, gdHorizontal);end; ---------------------------------------------------------------------- majid.ebru · 2017-09-24 04:29 Hi Thank you i have 4 questions: 1 - your code in my laptop worked correctly but this doesn't work in onther PC ?!?! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit1.pas(36,12) Error: identifier idents no member "CenterPoint" 2 - can i use this code for Panel ? (can i  paint Panel whit this code?) 3 - can you splitte(separate) color code ? 4 - can you show show code of color like "$00939393" ? ---------------------------------------------------------------------- howardpc · 2017-09-24 07:41 Quote from: majid.ebru on September 24, 2017, 06:29:48 am1 - your code in my laptop worked correctly but this doesn't work in onther PC ?!?! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit1.pas(36,12) Error: identifier idents no member "CenterPoint"CenterPoint and various other TRect properties were added only in a recent FPC version. For older FPC compiler versions with an older RTL/FCL you will have to calculate the centre point yourself. I'm sure you can do that. Quote from: majid.ebru on September 24, 2017, 06:29:48 am2 - can i use this code for Panel ? (can i  paint Panel whit this code?)Generate an OnPaint handler for your panel and do something like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Panel1Paint(Sender: TObject);begin  Panel1.Canvas.GradientFill(Panel1.ClientRect, RGBToColor($ff,$ff,$ff), RGBToColor($93,$93,$93),gdHorizontal);end; Quote from: majid.ebru on September 24, 2017, 06:29:48 am3 - can you splitte(separate) color code ?I don't understand what you mean. Quote from: majid.ebru on September 24, 2017, 06:29:48 am4 - can you show show code of color like "$00939393" ? See code above. ---------------------------------------------------------------------- majid.ebru · 2017-09-24 10:56 Thank you