diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-03-15 09:02:55 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-03-15 09:18:47 +0200 |
commit | 80854141ccc4cb7ca405703681edc5b97a5ba457 (patch) | |
tree | e0722123ab1c5179612875ccb81a4e8d555ab927 /src/corelib | |
parent | 1d9199096a23beaf3ad792374f30bdd67cb2d933 (diff) | |
download | fpGUI-80854141ccc4cb7ca405703681edc5b97a5ba457.tar.xz |
Enable usage of Alpha channel when color type is created or converted.
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/fpg_base.pas | 11 |
1 files changed, 6 insertions, 5 deletions
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; |