/// <summary> /// Draws a control's background. /// </summary> public static void DrawBackground(this SKCanvas canvas, Rectangle bounds, ControlStyle style) { var radius = style.Border.GetRadius(); if (radius > 0) { canvas.Clear(SKColors.Transparent); canvas.FillRoundedRectangle(0, 0, bounds.Width - style.Border.GetWidth(), bounds.Height - style.Border.GetWidth(), style.GetBackgroundColor(), radius, radius, style.Border.GetWidth()); return; } canvas.Clear(style.GetBackgroundColor()); }
public static void DrawBackground(this SKCanvas canvas, ControlStyle style) => canvas.Clear(style.GetBackgroundColor());
/// <summary> /// Gets the computed background color. /// </summary> public SKColor GetBackgroundColor() => BackgroundColor ?? _parent? .GetBackgroundColor() ?? Theme.NeutralGray;
public SKColor GetBackgroundColor() => BackgroundColor ?? _parent.GetBackgroundColor();