Changed RGBA_Bytes -> Color

This commit is contained in:
Lars Brubaker 2017-10-31 11:43:25 -07:00
parent c6a3c14118
commit 8d1fecab8c
107 changed files with 495 additions and 495 deletions

View file

@ -168,7 +168,7 @@ namespace MatterHackers.MatterControl.PrinterControls
Margin = new BorderDouble(5, 0),
Value = ExtrusionMultiplyerStream.ExtrusionRatio
};
extrusionRatioSlider.BackgroundColor = new RGBA_Bytes();
extrusionRatioSlider.BackgroundColor = new Color();
extrusionRatioSlider.ValueChanged += (sender, e) =>
{
extrusionValue.ActuallNumberEdit.Value = Math.Round(extrusionRatioSlider.Value, 2);

View file

@ -282,10 +282,10 @@ namespace MatterHackers.MatterControl.PrinterControls
public class XYZColors
{
public static RGBA_Bytes eColor = new RGBA_Bytes(180, 180, 180);
public static RGBA_Bytes xColor = new RGBA_Bytes(180, 180, 180);
public static RGBA_Bytes yColor = new RGBA_Bytes(255, 255, 255);
public static RGBA_Bytes zColor = new RGBA_Bytes(255, 255, 255);
public static Color eColor = new Color(180, 180, 180);
public static Color xColor = new Color(180, 180, 180);
public static Color yColor = new Color(255, 255, 255);
public static Color zColor = new Color(255, 255, 255);
public XYZColors()
{

View file

@ -386,7 +386,7 @@ namespace MatterHackers.MatterControl
macroRow.Margin = new BorderDouble(3, 0, 3, 3);
macroRow.HAnchor = Agg.UI.HAnchor.Stretch;
macroRow.Padding = new BorderDouble(3);
macroRow.BackgroundColor = RGBA_Bytes.White;
macroRow.BackgroundColor = Color.White;
TextWidget buttonLabel = new TextWidget(GCodeMacro.FixMacroName(macro.Name));
macroRow.AddChild(buttonLabel);

View file

@ -29,10 +29,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{
if (this.Enabled)
{
this.TextColor = RGBA_Bytes.White;
this.TextColor = Color.White;
}
{
this.TextColor = RGBA_Bytes.Gray;
this.TextColor = Color.Gray;
}
}
}
@ -50,8 +50,8 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
public class OptionContainer : GuiWidget
{
private RGBA_Bytes borderColor = new RGBA_Bytes(63, 63, 70);
private RGBA_Bytes backgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
private Color borderColor = new Color(63, 63, 70);
private Color backgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
public OptionContainer()
: base()
@ -162,7 +162,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
public class LabelContainer : GuiWidget
{
private RGBA_Bytes backgroundColor = new RGBA_Bytes(0, 140, 158);
private Color backgroundColor = new Color(0, 140, 158);
public LabelContainer()
: base()
@ -181,8 +181,8 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
//Base widget for use in ButtonStatesViewWidget
public class ControlButtonViewBase : GuiWidget
{
protected RGBA_Bytes fillColor;
protected RGBA_Bytes borderColor;
protected Color fillColor;
protected Color borderColor;
protected double borderWidth;
protected double borderRadius;
protected double padding;
@ -194,9 +194,9 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
double borderWidth,
double borderRadius,
double padding,
RGBA_Bytes textColor,
RGBA_Bytes fillColor,
RGBA_Bytes borderColor)
Color textColor,
Color fillColor,
Color borderColor)
: base(width, height)
{
this.borderRadius = borderRadius;

View file

@ -81,7 +81,7 @@ namespace MatterHackers.MatterControl
if (Focused)
{
graphics2D.Rectangle(LocalBounds, RGBA_Bytes.Orange);
graphics2D.Rectangle(LocalBounds, Color.Orange);
}
}
}

View file

@ -216,7 +216,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
catch
{
printerBaudRateHelpLink.Visible = false;
printerBaudRateError.TextColor = RGBA_Bytes.Red;
printerBaudRateError.TextColor = Color.Red;
printerBaudRateError.Text = "Oops! Please select a baud rate.".Localize();
}
@ -230,7 +230,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
catch
{
printerBaudRateHelpLink.Visible = false;
printerBaudRateError.TextColor = RGBA_Bytes.Red;
printerBaudRateError.TextColor = Color.Red;
printerBaudRateError.Text = "Oops! Baud Rate must be an integer.".Localize();
return false;
}

View file

@ -86,7 +86,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
catch
{
printerComPortHelpLink.Visible = false;
printerComPortError.TextColor = RGBA_Bytes.Red;
printerComPortError.TextColor = Color.Red;
printerComPortError.Text = "Oops! Please select a serial port.".Localize();
}
};
@ -179,7 +179,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
else if (printer.Connection.CommunicationState != CommunicationStates.AttemptingToConnect)
{
printerComPortHelpLink.Visible = false;
printerComPortError.TextColor = RGBA_Bytes.Red;
printerComPortError.TextColor = Color.Red;
printerComPortError.Text = "Uh-oh! Could not connect to printer.".Localize();
connectButton.Visible = true;
nextButton.Visible = false;

View file

@ -68,7 +68,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
string candidatePort = FrostedSerialPort.GetPortNames().Except(startingPortNames).FirstOrDefault();
if (candidatePort == null)
{
printerErrorMessage.TextColor = RGBA_Bytes.Red;
printerErrorMessage.TextColor = Color.Red;
printerErrorMessage.Text = "Oops! Printer could not be detected ".Localize();
}
else
@ -142,7 +142,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
printerErrorMessage = new TextWidget("", 0, 0, 10)
{
AutoExpandBoundsToText = true,
TextColor = RGBA_Bytes.Red,
TextColor = Color.Red,
HAnchor = HAnchor.Stretch,
Margin = elementMargin
};
@ -169,7 +169,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
}
else if (printer.Connection.CommunicationState != CommunicationStates.AttemptingToConnect)
{
printerErrorMessage.TextColor = RGBA_Bytes.Red;
printerErrorMessage.TextColor = Color.Red;
printerErrorMessage.Text = "Uh-oh! Could not connect to printer.".Localize();
connectButton.Visible = true;
nextButton.Visible = false;

View file

@ -321,7 +321,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
}
else
{
this.printerNameError.TextColor = RGBA_Bytes.Red;
this.printerNameError.TextColor = Color.Red;
this.printerNameError.Text = "Printer name cannot be blank".Localize();
this.printerNameError.Visible = true;

View file

@ -43,7 +43,7 @@ namespace MatterHackers.MatterControl
this.textScrollWidget = textScrollWidget;
Margin = new BorderDouble(0, 5);
VAnchor = Agg.UI.VAnchor.Stretch;
BackgroundColor = RGBA_Bytes.LightGray;
BackgroundColor = Color.LightGray;
}
public override void OnDraw(Graphics2D graphics2D)
@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl
//graphics2D.Rectangle(LocalBounds, RGBA_Bytes.Black);
double bottom = textScrollWidget.Position0To1 * (Height - thumbHeight);// the 2 is the border
RectangleDouble thumb = new RectangleDouble(0, bottom, Width, bottom + thumbHeight);// the 1 is the border
graphics2D.FillRectangle(thumb, RGBA_Bytes.DarkGray);
graphics2D.FillRectangle(thumb, Color.DarkGray);
base.OnDraw(graphics2D);
}

View file

@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl
private TypeFacePrinter printer = null;
public RGBA_Bytes TextColor = new RGBA_Bytes(102, 102, 102);
public Color TextColor = new Color(102, 102, 102);
private int forceStartLine = -1;
public double Position0To1

View file

@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl
public JogControls(PrinterConfig printer, XYZColors colors)
{
this.printer = printer;
moveButtonFactory.Colors.Text.Normal = RGBA_Bytes.Black;
moveButtonFactory.Colors.Text.Normal = Color.Black;
double distanceBetweenControls = 12;
double buttonSeparationDistance = 10;
@ -92,7 +92,7 @@ namespace MatterHackers.MatterControl
// add in some movement radio buttons
FlowLayoutWidget setMoveDistanceControl = new FlowLayoutWidget();
TextWidget buttonsLabel = new TextWidget("Distance:", textColor: RGBA_Bytes.White);
TextWidget buttonsLabel = new TextWidget("Distance:", textColor: Color.White);
buttonsLabel.VAnchor = Agg.UI.VAnchor.Center;
//setMoveDistanceControl.AddChild(buttonsLabel);
@ -175,7 +175,7 @@ namespace MatterHackers.MatterControl
#endif
GuiWidget barBetweenZAndE = new GuiWidget(2, 2);
barBetweenZAndE.VAnchor = Agg.UI.VAnchor.Stretch;
barBetweenZAndE.BackgroundColor = RGBA_Bytes.White;
barBetweenZAndE.BackgroundColor = Color.White;
barBetweenZAndE.Margin = new BorderDouble(distanceBetweenControls, 5);
allControlsLeftToRight.AddChild(barBetweenZAndE);
@ -493,7 +493,7 @@ namespace MatterHackers.MatterControl
// add in some movement radio buttons
FlowLayoutWidget setMoveDistanceControl = new FlowLayoutWidget();
TextWidget buttonsLabel = new TextWidget("Distance:", textColor: RGBA_Bytes.White);
TextWidget buttonsLabel = new TextWidget("Distance:", textColor: Color.White);
buttonsLabel.VAnchor = Agg.UI.VAnchor.Center;
//setMoveDistanceControl.AddChild(buttonsLabel);
@ -551,7 +551,7 @@ namespace MatterHackers.MatterControl
return button;
}
public static FlowLayoutWidget CreateZButtons(PrinterConfig printer, RGBA_Bytes color, double buttonSeparationDistance,
public static FlowLayoutWidget CreateZButtons(PrinterConfig printer, Color color, double buttonSeparationDistance,
out MoveButton zPlusControl, out MoveButton zMinusControl, bool levelingButtons = false)
{
FlowLayoutWidget zButtons = new FlowLayoutWidget(FlowDirection.TopToBottom);
@ -698,14 +698,14 @@ namespace MatterHackers.MatterControl
{
public double BorderWidth { get; set; } = 1;
private RGBA_Bytes borderColor;
private Color borderColor;
private Stroke borderStroke = null;
public MoveButtonWidget(string label, RGBA_Bytes textColor, double fontSize = 12)
public MoveButtonWidget(string label, Color textColor, double fontSize = 12)
{
this.Margin = 0;
this.Padding = 0;
this.borderColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 200);
this.borderColor = new Color(ActiveTheme.Instance.PrimaryTextColor, 200);
this.AnchorAll();
@ -744,10 +744,10 @@ namespace MatterHackers.MatterControl
public class WidgetStateColors
{
public RGBA_Bytes Normal { get; set; }
public RGBA_Bytes Hover { get; set; }
public RGBA_Bytes Pressed { get; set; }
public RGBA_Bytes Disabled { get; set; }
public Color Normal { get; set; }
public Color Hover { get; set; }
public Color Pressed { get; set; }
public Color Disabled { get; set; }
}
public class WidgetColors
@ -765,17 +765,17 @@ namespace MatterHackers.MatterControl
{
Text = new WidgetStateColors()
{
Normal = RGBA_Bytes.Black,
Hover = RGBA_Bytes.White,
Pressed = RGBA_Bytes.White,
Disabled = RGBA_Bytes.White
Normal = Color.Black,
Hover = Color.White,
Pressed = Color.White,
Disabled = Color.White
},
Fill = new WidgetStateColors()
{
Normal = RGBA_Bytes.White,
Hover = new RGBA_Bytes(0, 0, 0, 50),
Pressed = RGBA_Bytes.Transparent,
Disabled = new RGBA_Bytes(255, 255, 255, 50)
Normal = Color.White,
Hover = new Color(0, 0, 0, 50),
Pressed = Color.Transparent,
Disabled = new Color(255, 255, 255, 50)
}
};