From 80854141ccc4cb7ca405703681edc5b97a5ba457 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 15 Mar 2012 09:02:55 +0200 Subject: Enable usage of Alpha channel when color type is created or converted. --- src/corelib/fpg_base.pas | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index 9046f273..273bd074 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -959,7 +959,7 @@ begin Red := fpgGetRed(AColor); Green := fpgGetGreen(AColor); Blue := fpgGetBlue(AColor); -// Alpha := fpgGetAlpha(AColor); + Alpha := fpgGetAlpha(AColor); end end; @@ -970,18 +970,18 @@ begin Red := fpgGetRed(AColor); Green := fpgGetGreen(AColor); Blue := fpgGetBlue(AColor); -// Alpha := fpgGetAlpha(AColor); + Alpha := fpgGetAlpha(AColor); end end; function RGBTripleTofpgColor(const AColor: TRGBTriple): TfpgColor; deprecated; begin - Result := AColor.Blue or (AColor.Green shl 8) or (AColor.Red shl 16);// or (AColor.Alpha shl 32); + Result := AColor.Blue or (AColor.Green shl 8) or (AColor.Red shl 16) or (AColor.Alpha shl 32); end; function FPColorTofpgColor(const AColor: TFPColor): TfpgColor; begin - Result := AColor.Blue or (AColor.Green shl 8) or (AColor.Red shl 16);// or (AColor.Alpha shl 32); + Result := AColor.Blue or (AColor.Green shl 8) or (AColor.Red shl 16) or (AColor.Alpha shl 32); end; function fpgGetRed(const AColor: TfpgColor): word; @@ -1036,7 +1036,8 @@ end; function fpgColor(const ARed, AGreen, ABlue: byte): TfpgColor; begin - Result := ABlue or (AGreen shl 8) or (ARed shl 16); + { color is always fully opaque } + Result := ABlue or (AGreen shl 8) or (ARed shl 16) or ($FF shl 24); end; function fpgDarker(const AColor: TfpgColor; APercent: Byte): TfpgColor; -- cgit v1.2.3-70-g09d2