aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2021-03-22 18:06:50 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2021-03-22 18:06:50 +0200
commit15a3a16275590dec76658cffd0fb1f9be540798c (patch)
tree1700d3d563fd246ddea7b0fc240526cf1eb863f8 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs
parentc4a8675454df38bb1e604ee0fdbd4cc387b431fb (diff)
downloadTango-15a3a16275590dec76658cffd0fb1f9be540798c.tar.gz
Tango-15a3a16275590dec76658cffd0fb1f9be540798c.zip
Fixed issue in RML module => Color Conversion => RGB/LAB final display.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs35
1 files changed, 21 insertions, 14 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs
index e8b8cbe86..f06a91f90 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs
@@ -17,8 +17,12 @@ namespace Tango.MachineStudio.RML.ViewModels
public event EventHandler<Color> ColorChanged;
+ public bool SynchronizeColorSpaces { get; set; }
+
public RgbVM()
{
+ SynchronizeColorSpaces = true;
+
_color_change_timer = new DispatcherTimer();
_color_change_timer.Interval = TimeSpan.FromMilliseconds(30);
_color_change_timer.Tick += _color_change_timer_Tick;
@@ -94,21 +98,24 @@ namespace Tango.MachineStudio.RML.ViewModels
{
_color_change_timer.Stop();
- if (!IsLab)
- {
- Rgb rgb = new Rgb(Red, Green, Blue);
- Lab lab = rgb.To<Lab>();
- _l = lab.L;
- _a = lab.A;
- _b = lab.B;
- }
- else
+ if (SynchronizeColorSpaces)
{
- Lab lab = new Lab(L, A, B);
- Rgb rgb = lab.To<Rgb>();
- _red = (int)rgb.R;
- _green = (int)rgb.G;
- _blue = (int)rgb.B;
+ if (!IsLab)
+ {
+ Rgb rgb = new Rgb(Red, Green, Blue);
+ Lab lab = rgb.To<Lab>();
+ _l = lab.L;
+ _a = lab.A;
+ _b = lab.B;
+ }
+ else
+ {
+ Lab lab = new Lab(L, A, B);
+ Rgb rgb = lab.To<Rgb>();
+ _red = (int)rgb.R;
+ _green = (int)rgb.G;
+ _blue = (int)rgb.B;
+ }
}
_color = Color.FromRgb((byte)Red, (byte)Green, (byte)Blue);