Changeset 50 for trunk/UGame.pas


Ignore:
Timestamp:
Nov 3, 2019, 12:18:14 PM (5 years ago)
Author:
chronos
Message:
  • Added: Support for dark theme.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGame.pas

    r49 r50  
    130130    UndoEnabled: Boolean;
    131131    History: THistory;
     132    BackgroundColor: TColor;
    132133    function CanUndo: Boolean;
    133134    procedure Undo;
     
    182183implementation
    183184
     185uses
     186  UCore;
     187
    184188procedure Translate;
    185189begin
     
    593597  TileMargin := Round(CanvasSize.X / Board.Size.X * 0.015);
    594598  Canvas.Brush.Style := bsSolid;
    595   Canvas.Brush.Color := clBlack;
     599  Canvas.Brush.Color := Core.ThemeManager1.Theme.ColorControl;
    596600  Canvas.FillRect(0, 0, Canvas.Width, Canvas.Height);
    597601
    598602  ValueStr := SScore + ': ' + IntToStr(Score);
    599   Canvas.Font.Color := clWhite;
     603  Canvas.Font.Color := Core.ThemeManager1.Theme.ColorControlText;
    600604  Canvas.Font.Height := Trunc(TopBarHeight * 0.7);
    601605  Canvas.TextOut(ScaleY(16, 96), (TopBarHeight - Canvas.TextHeight(ValueStr)) div 2, ValueStr);
    602606
    603607  ValueStr := STopScore + ': ' + IntToStr(TopScore);
    604   Canvas.Font.Color := clWhite;
     608  Canvas.Font.Color := Core.ThemeManager1.Theme.ColorControlText;
    605609  Canvas.Font.Height := Trunc(TopBarHeight * 0.7);
    606610  Canvas.TextOut(ScaleY(136, 96), (TopBarHeight - Canvas.TextHeight(ValueStr)) div 2, ValueStr);
     
    10301034function TGame.GetTileColor(Value: Integer): TColor;
    10311035begin
    1032   case Value of
    1033     0: Result := $f2f6f9;
    1034     1: Result := $dae4ee;
    1035     2: Result := $c8e0ed;
    1036     3: Result := $79b1f2;
    1037     4: Result := $6395f5;
    1038     5: Result := $5f7cf6;
    1039     6: Result := $3b5ef6;
    1040     7: Result := $72cfed;
    1041     8: Result := $61cced;
    1042     9: Result := $50c8ed;
    1043     10: Result := $3fc5ed;
    1044     11: Result := $2ec2ed;
    1045     else Result := $323a3c;
     1036  if Core.ThemeManager1.Theme.Name = 'Dark' then begin
     1037    case Value of
     1038      0: Result := $222629;
     1039      1: Result := $dae4ee;
     1040      2: Result := $c8e0ed;
     1041      3: Result := $79b1f2;
     1042      4: Result := $6395f5;
     1043      5: Result := $5f7cf6;
     1044      6: Result := $3b5ef6;
     1045      7: Result := $72cfed;
     1046      8: Result := $61cced;
     1047      9: Result := $50c8ed;
     1048      10: Result := $3fc5ed;
     1049      11: Result := $2ec2ed;
     1050      else Result := $323a3c;
     1051    end;
     1052  end else begin
     1053    case Value of
     1054      0: Result := $f2f6f9;
     1055      1: Result := $dae4ee;
     1056      2: Result := $c8e0ed;
     1057      3: Result := $79b1f2;
     1058      4: Result := $6395f5;
     1059      5: Result := $5f7cf6;
     1060      6: Result := $3b5ef6;
     1061      7: Result := $72cfed;
     1062      8: Result := $61cced;
     1063      9: Result := $50c8ed;
     1064      10: Result := $3fc5ed;
     1065      11: Result := $2ec2ed;
     1066      else Result := $323a3c;
     1067    end;
    10461068  end;
    10471069end;
Note: See TracChangeset for help on using the changeset viewer.