/// <inheritdoc /> public override void SetBackground(JdenticonColor color, Rectangle iconBounds) { context.DrawRectangle( brush: new SolidColorBrush(color.ToWpf()), pen: null, rectangle: iconBounds.ToWpf()); }
/// <inheritdoc /> public override void SetBackground(JdenticonColor color) { if (color.A > 0) { context.DrawRectangle( brush: new SolidColorBrush(color.ToWpfColor()), pen: null, rectangle: new Rect(0, 0, width, height)); } }
/// <inheritdoc /> public override IDisposable BeginShape(JdenticonColor color) { if (!pathsByColor.TryGetValue(color, out currentPath)) { pathsByColor[color] = currentPath = new PathGeometry { FillRule = FillRule.Nonzero }; } return(ActionDisposable.Empty); }
/// <inheritdoc /> public override IDisposable BeginShape(JdenticonColor color) { currentPath = new PathGeometry { FillRule = FillRule.Nonzero }; return(new ActionDisposable(() => { context.DrawGeometry( brush: new SolidColorBrush(color.ToWpfColor()), pen: null, geometry: currentPath); currentPath = null; })); }