aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-10-01 09:52:36 -0600
committerAShifter <[email protected]>2017-10-01 09:52:36 -0600
commitb45df71168d5fa3f817c45194e4019d15b3a2aa0 (patch)
tree55e0f988107830ffb809acef6d5ac8c25722ef7b /ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
parent46fe7eb7098dd31b186e13e228fede07c46ee064 (diff)
downloadshiftos-rewind-b45df71168d5fa3f817c45194e4019d15b3a2aa0.tar.gz
shiftos-rewind-b45df71168d5fa3f817c45194e4019d15b3a2aa0.tar.bz2
shiftos-rewind-b45df71168d5fa3f817c45194e4019d15b3a2aa0.zip
Shifting is working
owow
Diffstat (limited to 'ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs')
-rw-r--r--ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs43
1 files changed, 17 insertions, 26 deletions
diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
index 697e22e..f9f8f72 100644
--- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
+++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
@@ -14,40 +14,31 @@ namespace ShiftOS.Main.ShiftOS.Apps
public SelectColor()
{
InitializeComponent();
-
+
}
private void btnSetColor_Click(object sender, EventArgs e)
{
+ _colorType1 = Int32.Parse(redUpDown.Value.ToString());
+ _colorType2 = Int32.Parse(greenUpDown.Value.ToString());
+ _colorType3 = Int32.Parse(blueUpDown.Value.ToString());
try
{
- _colorType1 = Convert.ToInt32(textBox1.Text);
- _colorType2 = Convert.ToInt32(textBox2.Text);
- _colorType3 = Convert.ToInt32(textBox3.Text);
- }
- catch(FormatException ex)
- {
- ShiftWM.StartInfoboxSession("Error!", "Failed to parse integer. Error:\n" + ex, InfoboxTemplate.ButtonType.Ok);
- }
-
- if (_colorType1 > 255 || _colorType2 > 255 || _colorType3 > 255)
- {
- ShiftWM.StartInfoboxSession("Error!", "A value cannot be greater than 255!", InfoboxTemplate.ButtonType.Ok);
+ _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3);
+ //BackColor = _finalColor;
+
+ foreach (var window in ShiftWM.Windows)
+{
+ window.Invoke(new Action(() => window.top.BackColor = _finalColor));
+ }
+
+ ShiftWM.StartInfoboxSession("Success!", $"Changed color to:\r\n{_colorType1}, {_colorType2}, {_colorType3}.", InfoboxTemplate.ButtonType.Ok);
}
- else
+ catch (Exception)
{
- try
- {
- ShiftWindow sw = new ShiftWindow();
- _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3);
- BackColor = _finalColor;
- ShiftWM.StartInfoboxSession("Success!", "Changed color to:\n" + _colorType1.ToString() + ", " + _colorType2.ToString() + ", " + _colorType3.ToString() + ".", InfoboxTemplate.ButtonType.Ok);
- }
- catch (Exception)
- {
- ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok);
- }
+ ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok);
}
+ //return _finalColor;
}
}
-}
+ }