Skip to content

Commit

Permalink
choose background color
Browse files Browse the repository at this point in the history
  • Loading branch information
circular17 committed Jun 16, 2024
1 parent cf30b9c commit b875a7e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
28 changes: 28 additions & 0 deletions superformula_ui/umain.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ object frmSuperFormula: TfrmSuperFormula
ParentColor = False
ParentFont = False
TabOrder = 0
OnClick = vsPreviewClick
OnMouseWheelDown = vsPreviewMouseWheelDown
OnMouseWheelUp = vsPreviewMouseWheelUp
end
Expand Down Expand Up @@ -301,4 +302,31 @@ object frmSuperFormula: TfrmSuperFormula
Value = 1
end
end
object ColorDialog1: TColorDialog
Color = clBlack
CustomColors.Strings = (
'ColorA=000000'
'ColorB=000080'
'ColorC=008000'
'ColorD=008080'
'ColorE=800000'
'ColorF=800080'
'ColorG=808000'
'ColorH=808080'
'ColorI=C0C0C0'
'ColorJ=0000FF'
'ColorK=00FF00'
'ColorL=00FFFF'
'ColorM=FF0000'
'ColorN=FF00FF'
'ColorO=FFFF00'
'ColorP=FFFFFF'
'ColorQ=C0DCC0'
'ColorR=F0CAA6'
'ColorS=F0FBFF'
'ColorT=A4A0A0'
)
Left = 753
Top = 732
end
end
14 changes: 11 additions & 3 deletions superformula_ui/umain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ TfrmSuperFormula = class(TForm)
cbFillColor: TColorButton;
cbMRational: TCheckBox;
cbSpikeOverlap: TCheckBox;
ColorDialog1: TColorDialog;
edValueA: TFloatSpinEdit;
edValueB: TFloatSpinEdit;
edValueM: TFloatSpinEdit;
Expand Down Expand Up @@ -54,18 +55,18 @@ TfrmSuperFormula = class(TForm)
procedure edValueN3Change(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure vsPreviewClick(Sender: TObject);
procedure vsPreviewMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: boolean);
procedure vsPreviewMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: boolean);
procedure vsPreviewRedraw(Sender: TObject; Bitmap: TBGRABitmap);
procedure FormCreate(Sender: TObject);
private
procedure OriginalChange(ASender: TObject; AOriginal: TBGRALayerCustomOriginal; var ADiff: TBGRAOriginalDiff);
procedure UpdateFraction;
public
FLayers: TBGRALayeredBitmap;
FSuperformula: TBGRALayerSuperformulaOriginal;
procedure OriginalChange(ASender: TObject; AOriginal: TBGRALayerCustomOriginal; var ADiff: TBGRAOriginalDiff);
procedure UpdateFraction;
end;

var
Expand Down Expand Up @@ -173,6 +174,13 @@ procedure TfrmSuperFormula.FormDestroy(Sender: TObject);
FLayers.Free;
end;

procedure TfrmSuperFormula.vsPreviewClick(Sender: TObject);
begin
ColorDialog1.Color := vsPreview.Color;
if ColorDialog1.Execute then
vsPreview.Color := ColorDialog1.Color;
end;

procedure TfrmSuperFormula.vsPreviewMouseWheelDown(Sender: TObject;
Shift: TShiftState; MousePos: TPoint; var Handled: boolean);
begin
Expand Down

0 comments on commit b875a7e

Please sign in to comment.