[SOLVED] Problem setting UI component color to 'Orange' lazarus / 31-LCL ---------------------------------------------------------------------- fatmonk · 2018-03-21 14:58 I'm trying to set a label (or anything else) to an orange color, but it is coming out blue... I'm using: 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 myTlabel.Font.Color:=$FFA500; Using any of the pre-defined colors works, but I get the same problem when I define new constant as: 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 const  clOrange: TColor = $FFA500; and then try to us clOrange as my font color. Every time it comes out blue... I'm confused. -FM ---------------------------------------------------------------------- WooBean · 2018-03-21 15:18 Hi, would you show the source stating that orange color (as TColor) is equal to $FFA500? Do not belive that source. Millions applications paint coloured components but not yours one? WooBean ---------------------------------------------------------------------- fatmonk · 2018-03-21 15:44 I have shown the source code! I am FFA500 is the RGB code for orange. If I try to set a component to that colour explicitly it comes out blue. If I define a new TColor constant to that value and use that it also comes out blue. I don't know what you are asking for as I have shown the source code where I am defining a constant to use and the source code assigning the colour directly. -FM ---------------------------------------------------------------------- Bart · 2018-03-21 15:54 Try $00A5FF instead. RGB does not translate to "$RRGGBB" as a TColor. There are also several conversionroutines to transform R,G,B to TColor IIRC. From Graphics unit: function RGBToColor(R, G, B: Byte): TColor; Bart ---------------------------------------------------------------------- taazz · 2018-03-21 15:55 endianess? try using the rgbtocolor function or if you are on windows my freeware color picker utility. https://github.com/taazz/EvsSimpleGr aph/releases/download/v1/ColorUtil.exe ---------------------------------------------------------------------- WooBean · 2018-03-21 15:59 Try this value: $0000A5FF                 BLUE GREEN RED WooBean ---------------------------------------------------------------------- fatmonk · 2018-03-21 16:02 $00A5FF has got it. I guessed it was an RGB order thing, and thought I'd tried all combinations but obviously missed that order. Oddly I also tried using various 0000FF and 00FF00 type combinations to try to figure out the RGB order and it seemed to be red first then green then blue! Tazz's endianess suggestion could be the clue, then, unless I was just getting really really confused. -FM ---------------------------------------------------------------------- Handoko · 2018-03-21 16:59 In my Graphics.pp line #265, you can see 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   // standard colors  clBlack   = TColor($000000);  clMaroon  = TColor($000080);  clGreen   = TColor($008000);  clOlive   = TColor($008080);  clNavy    = TColor($800000);  clPurple  = TColor($800080);  clTeal    = TColor($808000);  clGray    = TColor($808080);  clSilver  = TColor($C0C0C0);  clRed     = TColor($0000FF);  clLime    = TColor($00FF00);  clYellow  = TColor($00FFFF);  clBlue    = TColor($FF0000);  clFuchsia = TColor($FF00FF);  clAqua    = TColor($FFFF00);  clLtGray  = TColor($C0C0C0); // clSilver alias  clDkGray  = TColor($808080); // clGray alias  clWhite   = TColor($FFFFFF); So it is clear, the TColor is using BGR order at least on my Gtk2 Linux. ---------------------------------------------------------------------- fatmonk · 2018-03-21 20:21 I had obviously just completely tied myself in knots, in that case. I had even hovered over some of the defined colours (clRed, clLime etc) to see which character pairs corresponded with the red, green and blue amounts! Thanks for clarifying and putting me right. (Does make you wonder why orange isn't a standard colour, though...) -Dan ---------------------------------------------------------------------- Thaddy · 2018-03-21 21:39 Cross the Dutch border maybe? We have no problem with Orange. Maybe your laptop starts to behave....