Hello all, I'm fairly new with Lazarus, but I'm typically able to troubleshoot the oddities I encounter. However, I have a particular issue I've been unable to solve for a few days now and I'm not really sure what else to try.
I need to create a TShape with colors stored in variables, but the color doesn't translate properly. Here is a rudimentary example of what I'm attempting to accomplish:
var
colorA:Integer;
begin
colorA := $0033CCFF;
myShape.Brush.Color := colorA;
end;
This results in myShape turning RGB(178,223,15) which is green, while the color I'm saving in colorA is RGB(255,204,102) which is yellow.
As a test:
myShape.Brush.Color := $0033CCFF;
myShape is correctly transformed into the desired color.
My question is simply how can I store colors in variables correctly? I've tried different types such as ShortInt and Cardinal, and something like:
var
colorA:String;
begin
colorA := '0033CCFF';
myShape.Brush.Color := StrToInt('$' + colorA);
end;
Just returns an error.
Furthermore, I've noticed there are some inconsistencies with the hexadecimal color codes Lazarus outputs compared to what I find in Photoshop. For example, the yellow color I'm interested in (RGB(255,204,102)) has the following hexadecimal values:
Via Photoshop: FFCC66
Via Lazarus: 0033CCFF
When I remove the 00 alpha and enter '33CCFF' into Photoshop, I get an RGB(51, 204, 255) which is blue.
Any help offered is greatly appreciated, I'm always eager to learn and I'm hoping I'm just missing something very simple! Also, it's important to note that I'm interested only in using very specific colors, not defaults such as clYellow.