public static void ColourMap(Primitive chartName, Primitive hue, Primitive saturation, Primitive lightness, Primitive hsl, Primitive start, Primitive end, Primitive centralColour)
{
Type GraphicsWindowType = typeof(GraphicsWindow);
Dictionary<string, UIElement> _objectsMap;
UIElement obj;
try
{
_objectsMap = (Dictionary<string, UIElement>)GraphicsWindowType.GetField("_objectsMap", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase).GetValue(null);
if (_objectsMap.TryGetValue((string)chartName, out obj))
{
InvokeHelper ret = new InvokeHelper(delegate
{
try
{
if (obj.GetType() == typeof(Chart))
{
Chart chart = (Chart)obj;
chart.hue = hue;
chart.saturation = saturation;
chart.lightness = lightness;
chart.startColor = start;
chart.endColor = end;
chart.centralColour = centralColour;
switch (((string)hsl).ToLower())
{
case "hue":
chart.eHSL = Chart.HSL.HUE;
break;
case "saturation":
chart.eHSL = Chart.HSL.SATURATION;
break;
case "lightness":
chart.eHSL = Chart.HSL.LIGHTNESS;
break;
}
chart.Update();
}
}
catch (Exception ex)
{
Utilities.OnError(Utilities.GetCurrentMethod(), ex);
}
});
FastThread.Invoke(ret);
}
else
{
Utilities.OnShapeError(Utilities.GetCurrentMethod(), chartName);
}
}
catch (Exception ex)
{
Utilities.OnError(Utilities.GetCurrentMethod(), ex);
}
}