/// <summary> /// Applies all attached and enabled decorators to the brush. /// </summary> /// <param name="rectangle">The rectangle in which the brush should be drawn.</param> /// <param name="renderTarget">The target (key/point) from which the color should be taken.</param> /// <param name="color">The <see cref="Color"/> to be modified.</param> protected virtual void ApplyDecorators(Rectangle rectangle, BrushRenderTarget renderTarget, ref Color color) { foreach (IBrushDecorator decorator in Decorators) { if (decorator.IsEnabled) { decorator.ManipulateColor(rectangle, renderTarget, ref color); } } }
/// <summary> /// Applies all attached and enabled decorators to the brush. /// </summary> /// <param name="rectangle">The rectangle in which the brush should be drawn.</param> /// <param name="renderTarget">The target (key/point) from which the color should be taken.</param> /// <param name="color">The <see cref="Color"/> to be modified.</param> protected virtual Color ApplyDecorators(Rectangle rectangle, BrushRenderTarget renderTarget, Color color) { foreach (IBrushDecorator decorator in Decorators) { if (decorator.IsEnabled) { color = decorator.ManipulateColor(rectangle, renderTarget, color); } } return(color); }
/// <summary> /// Gets the color at an specific point assuming the brush is drawn into the given rectangle. /// </summary> /// <param name="rectangle">The rectangle in which the brush should be drawn.</param> /// <param name="renderTarget">The target (key/point) from which the color should be taken.</param> /// <returns>The color at the specified point.</returns> protected abstract Color GetColorAtPoint(Rectangle rectangle, BrushRenderTarget renderTarget);