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

@ -54,12 +54,12 @@ namespace MatterHackers.MatterControl
var graphics2D = thumbIcon.NewGraphics2D();
var center = new Vector2(width / 2.0, width / 2.0);
graphics2D.DrawString("GCode", center.x, center.y, 8 * width / 50, Justification.Center, Baseline.BoundsCenter, color: RGBA_Bytes.White);
graphics2D.DrawString("GCode", center.x, center.y, 8 * width / 50, Justification.Center, Baseline.BoundsCenter, color: Color.White);
graphics2D.Render(
new Stroke(
new Ellipse(center, width / 2 - width / 12),
width / 12),
RGBA_Bytes.White);
Color.White);
thumbnailImage = thumbIcon;
}

View file

@ -39,7 +39,7 @@ namespace MatterHackers.MatterControl.Library
{
private static int currentColorIndex = 0;
private static RGBA_Bytes[] colors;
private static Color[] colors;
private static int totalColors = 0;
@ -56,12 +56,12 @@ namespace MatterHackers.MatterControl.Library
if (totalColors != value)
{
totalColors = value;
colors = Enumerable.Range(0, totalColors).Select(colorIndex => RGBA_Floats.FromHSL(colorIndex / (double)totalColors, 1, .5).GetAsRGBA_Bytes()).ToArray();
colors = Enumerable.Range(0, totalColors).Select(colorIndex => ColorF.FromHSL(colorIndex / (double)totalColors, 1, .5).GetAsRGBA_Bytes()).ToArray();
}
}
}
public static RGBA_Bytes NextColor()
public static Color NextColor()
{
return colors[(currentColorIndex++) % TotalColors];
}
@ -98,14 +98,14 @@ namespace MatterHackers.MatterControl.Library
/// </summary>
public Func<IObject3D> Collector { get; }
public RGBA_Bytes Color { get; set; }
public Color Color { get; set; }
public Task<IObject3D> GetContent(Action<double, string> reportProgress)
{
var result = Collector?.Invoke();
// If the content has not set a color, we'll assign from the running ColorRange
if (result.Color == RGBA_Bytes.Transparent)
if (result.Color == Color.Transparent)
{
result.Color = this.Color;
}

View file

@ -232,11 +232,11 @@ namespace MatterHackers.MatterControl.CustomWidgets
await this.LoadItemThumbnail();
}
public override RGBA_Bytes BackgroundColor
public override Color BackgroundColor
{
get
{
return this.IsSelected ? ActiveTheme.Instance.PrimaryAccentColor : RGBA_Bytes.Transparent;
return this.IsSelected ? ActiveTheme.Instance.PrimaryAccentColor : Color.Transparent;
}
set { }
}

View file

@ -84,8 +84,8 @@ namespace MatterHackers.MatterControl.CustomWidgets
public ILibraryContainer ActiveContainer => this.LibraryContext.ActiveContainer;
public RGBA_Bytes ThumbnailBackground { get; } = ActiveTheme.Instance.TertiaryBackgroundColor.AdjustLightness(1.05).GetAsRGBA_Bytes();
public RGBA_Bytes ThumbnailForeground { get; set; } = ActiveTheme.Instance.PrimaryAccentColor;
public Color ThumbnailBackground { get; } = ActiveTheme.Instance.TertiaryBackgroundColor.AdjustLightness(1.05).GetAsRGBA_Bytes();
public Color ThumbnailForeground { get; set; } = ActiveTheme.Instance.PrimaryAccentColor;
private async void ActiveContainer_Changed(object sender, ContainerChangedEventArgs e)
{
@ -299,7 +299,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
renderGraphics.Render(originalImage, width /2 - originalImage.Width /2, height /2 - originalImage.Height /2);
renderGraphics.FillRectangle(center, RGBA_Bytes.Transparent);
renderGraphics.FillRectangle(center, Color.Transparent);
return destImage;
}

View file

@ -254,7 +254,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
RectangleDouble Bounds = LocalBounds;
RoundedRect rectBorder = new RoundedRect(Bounds, 0);
this.BackgroundColor = RGBA_Bytes.White;
this.BackgroundColor = Color.White;
graphics2D.Render(new Stroke(rectBorder, 3), ActiveTheme.Instance.SecondaryAccentColor);
}

View file

@ -98,7 +98,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
this.VAnchor = VAnchor.Fit;
this.HAnchor = HAnchor.Stretch | HAnchor.Fit;
this.Height = 50;
this.BackgroundColor = RGBA_Bytes.White;
this.BackgroundColor = Color.White;
this.Padding = new BorderDouble(0);
this.Margin = new BorderDouble(6, 0, 6, 6);
@ -138,7 +138,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
partLabel = new TextWidget(listViewItem.Model.Name, pointSize: 14)
{
TextColor = RGBA_Bytes.Black,
TextColor = Color.Black,
MinimumSize = new Vector2(1, 18),
VAnchor = VAnchor.Center
};
@ -233,37 +233,37 @@ namespace MatterHackers.MatterControl.CustomWidgets
if (this.IsActivePrint && !this.EditMode)
{
this.BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor;
this.partLabel.TextColor = RGBA_Bytes.White;
this.partLabel.TextColor = Color.White;
//this.partStatus.TextColor = RGBA_Bytes.White;
this.viewButton.BackgroundColor = RGBA_Bytes.White;
this.viewButton.BackgroundColor = Color.White;
this.viewButtonLabel.TextColor = ActiveTheme.Instance.SecondaryAccentColor;
}
else if (this.IsSelected)
{
this.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor;
this.partLabel.TextColor = RGBA_Bytes.White;
this.partLabel.TextColor = Color.White;
//this.partStatus.TextColor = RGBA_Bytes.White;
this.selectionCheckBox.TextColor = RGBA_Bytes.White;
this.viewButton.BackgroundColor = RGBA_Bytes.White;
this.selectionCheckBox.TextColor = Color.White;
this.viewButton.BackgroundColor = Color.White;
this.viewButtonLabel.TextColor = ActiveTheme.Instance.SecondaryAccentColor;
}
else if (this.IsHoverItem)
{
this.BackgroundColor = RGBA_Bytes.White;
this.partLabel.TextColor = RGBA_Bytes.Black;
this.selectionCheckBox.TextColor = RGBA_Bytes.Black;
this.BackgroundColor = Color.White;
this.partLabel.TextColor = Color.Black;
this.selectionCheckBox.TextColor = Color.Black;
//this.partStatus.TextColor = RGBA_Bytes.Black;
this.viewButton.BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor;
this.viewButtonLabel.TextColor = RGBA_Bytes.White;
this.viewButtonLabel.TextColor = Color.White;
}
else
{
this.BackgroundColor = new RGBA_Bytes(255, 255, 255, 255);
this.partLabel.TextColor = RGBA_Bytes.Black;
this.selectionCheckBox.TextColor = RGBA_Bytes.Black;
this.BackgroundColor = new Color(255, 255, 255, 255);
this.partLabel.TextColor = Color.Black;
this.selectionCheckBox.TextColor = Color.Black;
//this.partStatus.TextColor = RGBA_Bytes.Black;
this.viewButton.BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor;
this.viewButtonLabel.TextColor = RGBA_Bytes.White;
this.viewButtonLabel.TextColor = Color.White;
}
}
@ -272,7 +272,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
var removeLabel = new TextWidget("Remove".Localize())
{
Name = "Queue Item " + listViewItem.Model.Name + " Remove",
TextColor = RGBA_Bytes.White,
TextColor = Color.White,
VAnchor = VAnchor.Center,
HAnchor = HAnchor.Center
};
@ -288,7 +288,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
viewButtonLabel = new TextWidget("View".Localize())
{
Name = "Queue Item " + listViewItem.Model.Name + " View",
TextColor = RGBA_Bytes.White,
TextColor = Color.White,
VAnchor = VAnchor.Center,
HAnchor = HAnchor.Center,
};