summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/fpg_x11.pas9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 92eaf454..c7a1b865 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -488,6 +488,13 @@ begin
Result := Result or ((rgb and $F80000) shr 8);
end;
+function ConvertTo555Pixel(rgb: longword): word;
+begin
+ Result := (rgb and $F8) shr 3;
+ Result := Result or ((rgb and $F800) shr 6);
+ Result := Result or ((rgb and $F80000) shr 9);
+end;
+
function fpgColorToX(col: TfpgColor): longword;
var
xc: TXColor;
@@ -499,6 +506,8 @@ begin
Result := c and $FFFFFF { No Alpha channel information }
else if xapplication.DisplayDepth = 16 then
Result := ConvertTo565Pixel(c)
+ else if (xapplication.DisplayDepth = 15) then
+ Result := ConvertTo555Pixel(c)
else
begin
c := col;