Good question, but I think this is not possible. If there is some overlay in the ControlTemplate, you cannot formulate a function that calculates a darker color, which then ends as the intended color.
eg. when you enter the red color which: 255,0,0 you get 255,153,153 , now the function that should be applied to your original color would be to darken the red color, this, of course, could only be done in the red channel as green and blue is already zero. However, the problem is not the red channel (which ends at 255 and therefore is not affected), so any changes in this will only discolor the color even more, instead of darkening it.
Edit: To make this a little more mathematical, the function used by selection transparency:
f (x) = 0.4x + 153
If you apply this to all the channels of your color, you will see that this is true. Now, how do we get the values ββwe need? Simple enough, invert the function, which is as follows:
f ^ (- 1) (x) = -2.5 (153.0 - x)
Fine! Now apply this to your color:
R: -130.0
G: 0
B: 140
Hmm, not so good, I suppose.
This is a negative value precisely because it is not always possible; every color that has components below 153 is not reversible.
HB
source share