private void DrawMarble(SKCanvas canvas, SKRect thisRect) // start with the marble piece. { var br_Fill = MiscHelpers.GetCenterGradientPaint(SKColors.White, MainColor.ToSKColor(), new SKPoint(thisRect.Left + (thisRect.Width / 2), thisRect.Top + (thisRect.Height / 2)), thisRect.Height / 2); SKPath gp = new SKPath(); gp.AddOval(thisRect); SKColor firstColor; SKColor secondColor; firstColor = new SKColor(255, 255, 255, 50); // 60 instead of 100 seems to do the trick secondColor = new SKColor(0, 0, 0, 50); var br_Shade = MiscHelpers.GetLinearGradientPaint(firstColor, secondColor, thisRect, MiscHelpers.EnumLinearGradientPercent.Angle45); canvas.DrawPath(gp, br_Fill); canvas.DrawPath(gp, br_Shade); }
public override void DrawImage(SKCanvas dc) { if (NeedsToClear == true) { dc.Clear();// needs to always clear. } if (Number == 0) { return; } SKColor thisColor; var tempColor = MainColor.ToSKColor(); thisColor = new SKColor(tempColor.Red, tempColor.Green, tempColor.Blue, 150); // i think var thisPaint = MiscHelpers.GetSolidPaint(thisColor); var thisRect = GetMainRect(); dc.DrawOval(thisRect, thisPaint); dc.DrawOval(thisRect, _borderPaint); var thisText = MiscHelpers.GetTextPaint(SKColors.White, thisRect.Height * 0.7f); dc.DrawCustomText(Number.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, thisText, thisRect, out _); }