Q:

How do you invert a color by %?

I know to invert a color you do:
invertedColor = 255 - color

But say I want to invert the color by 75%. How do I calculate that? I am trying it like this:
original color is rgb(100, 100, 100)
255 - 100 = 155
155 * .75 = 116.25
therefore i think (incorrectly) that my new color should be ~rgb(116, 116, 116)

But if you look at this fiddler the correct color is rgb(141, 141, 141);

A:

An inversion of color is actually (conceptually speaking, since 0% of anything is 0)
0% * color + 100% * (255 - color)

So a 75% inversion of color is
25% * color + 75% * (255 - color)

Basically you need some of the original color too.

