I wish to use the SharpDX method 'Lerp' with my SharpDX brush to lighten or darken a SharpDX brush.
Edit: I have managed to work this out but I would like someone to see if this meets best practices. I also want to leave this for anyone else who needs the snippet.
I have managed to do this:
SharpDX.Direct2D1.SolidColorBrush scb = (SharpDX.Direct2D1.SolidColorBrush)myBrushDX;
SharpDX.Color colorStart = (SharpDX.Color)scb.Color;
SharpDX.Color colorEnd = SharpDX.Color.White;
SharpDX.Color colorResult;
float amount = 0.9f;
SharpDX.Color.Lerp(ref colorStart, ref colorEnd, amount, out colorResult);
scb = new SharpDX.Direct2D1.SolidColorBrush(RenderTarget, colorResult);
myBrushDX = scb;
Comment