WPF SolidColorBrush color overlay (blending colors)

617 Views Asked by At

I am trying to find an easy way to change the color of an existing SolidColorBrush by adding a transparent overlay color. Is this possible without

  • using shader effects, or
  • putting a duplicate control on top with the overlay color?

I have been told that this MUST be possible on windows. Web developers are using this technique all the time, and this is how they communicate with the designers. They have a couple of key colours for a design, and they don't explicitly define each shade of a key color - instead they say "add 10% black". I know that this can be done easily in CSS, there you don't have to worry about the exact RGB values, all you have to define is just a blending with a 10% transparent black color. I am looking for something similar for WPF, where I could easily modify my existing colors without too much extra hassle (e.g. making a brush 10% darker, as if there was a 10% black object on top of it.)

I am not looking for a mathematical calculation for overlays, I know this can be done. I am looking for a trivial way to achieve this in WPF - similarly to CSS, where you can simply define overlay colors for blending. I would like to know if this is possible or not - in WPF.

0

There are 0 best solutions below