summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-04-10 16:33:14 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-04-10 16:33:14 +0200
commite563e3e901f446e60b017275d68b1de48d438e4a (patch)
tree7de41235b709249516c8a5e5c93f609bd0075397
parent7d6a1b14b6a0cc65c8032912f1e8861be89d57eb (diff)
downloadfpGUI-e563e3e901f446e60b017275d68b1de48d438e4a.tar.xz
pdf: implementation of TfpgColor to PDF Color was outdated.
Before TfpgColor did not contain Alpha channel information, but since recently it does. So we rather use the safer fpgGetXXX() methods to extract each color channel value.
-rw-r--r--extras/contributed/report_tool/reportengine/u_pdf.pas15
1 files changed, 7 insertions, 8 deletions
diff --git a/extras/contributed/report_tool/reportengine/u_pdf.pas b/extras/contributed/report_tool/reportengine/u_pdf.pas
index b4e8415d..25a89e97 100644
--- a/extras/contributed/report_tool/reportengine/u_pdf.pas
+++ b/extras/contributed/report_tool/reportengine/u_pdf.pas
@@ -212,7 +212,7 @@ type
protected
procedure WriteColor(const AFlux: TStream);
public
- constructor CreateColor(const AStroke: Boolean; Couleur: LongInt);
+ constructor CreateColor(const AStroke: Boolean; AColor: TfpgColor);
destructor Destroy; override;
end;
@@ -865,14 +865,13 @@ else
end;
end;
-constructor TPdfColor.CreateColor(const AStroke: Boolean; Couleur: Longint);
+constructor TPdfColor.CreateColor(const AStroke: Boolean; AColor: TfpgColor);
begin
-inherited Create;
-FBlue:= FormatFloat('0.##',Couleur mod 256/256);
-Couleur:= Couleur div 256;
-FGreen:= FormatFloat('0.##',Couleur mod 256/256);
-FRed:= FormatFloat('0.##',Couleur div 256/256);
-FStroke:= AStroke;
+ inherited Create;
+ FBlue := FormatFloat('0.##', fpgGetBlue(AColor)/256);
+ FGreen := FormatFloat('0.##', fpgGetGreen(AColor)/256);
+ FRed := FormatFloat('0.##', fpgGetRed(AColor)/256);
+ FStroke := AStroke;
end;
destructor TPdfColor.Destroy;