From e563e3e901f446e60b017275d68b1de48d438e4a Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 10 Apr 2012 16:33:14 +0200 Subject: 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. --- extras/contributed/report_tool/reportengine/u_pdf.pas | 15 +++++++-------- 1 file 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; -- cgit v1.2.3-70-g09d2