summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-03-15 09:02:55 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-03-15 09:18:47 +0200
commit80854141ccc4cb7ca405703681edc5b97a5ba457 (patch)
treee0722123ab1c5179612875ccb81a4e8d555ab927
parent1d9199096a23beaf3ad792374f30bdd67cb2d933 (diff)
downloadfpGUI-80854141ccc4cb7ca405703681edc5b97a5ba457.tar.xz
Enable usage of Alpha channel when color type is created or converted.
-rw-r--r--src/corelib/fpg_base.pas11
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;