Skip to content

Commit

Permalink
Default color reset for custom
Browse files Browse the repository at this point in the history
  • Loading branch information
farmerbriantee committed Feb 14, 2024
1 parent 3b369c2 commit 35b2708
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions SourceCode/GPS/Forms/Settings/FormColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using AgOpenGPS.Properties;
using System;
using System.Drawing;
using System.Globalization;
using System.Windows.Forms;

namespace AgOpenGPS
Expand Down Expand Up @@ -203,8 +204,21 @@ private void btnReset_Click(object sender, EventArgs e)
Settings.Default.setDisplay_colorTextDay = mf.textColorDay;
Settings.Default.setDisplay_colorTextNight = mf.textColorNight;

Settings.Default.setDisplay_customColors = "-62208,-12299010,-16190712,-1505559,-3621034,-16712458,-7330570,-1546731,-24406,-3289866,-2756674,-538377,-134768,-4457734,-1848839,-530985";

Properties.Settings.Default.Save();

string[] words = Properties.Settings.Default.setDisplay_customColors.Split(',');

for (int i = 0; i < 16; i++)
{
Color test;
mf.customColorsList[i] = int.Parse(words[i], CultureInfo.InvariantCulture);
test = Color.FromArgb(mf.customColorsList[i]).CheckColorFor255();
int iCol = (test.A << 24) | (test.R << 16) | (test.G << 8) | test.B;
mf.customColorsList[i] = iCol;
}

mf.SwapDayNightMode();
mf.SwapDayNightMode();
}
Expand Down

0 comments on commit 35b2708

Please sign in to comment.