title: How to generate a CSS color that is some specific percentage lighter/darker using JavaScript
body: <p>Let's say I have a color of #404040. How can I generate a new color hex code which is either lighter or darker by 20% (or another given percentage)? I need this for generating a color to apply on hover.</p>
  <p>The color being applied changes based on the chosen theme, therefore it is not possible to use another class or <code>:hover</code> with a predefined color value.</p>