Programatically lighten - darken colors

I’m working on a highly personalizable platform where companies can add their brand color.

Adding the main color is easy (I’m saving the Hex value in DB). However, for hover buttons, etc, I’d love to be able to have a lighter version of that brand color.

Has anyone figured this out? Is there a plugin that I’m not aware of?

1 Like

I use this extensively in my app. You can do it 2 ways:

  1. Within the thing itself add the opacity value to the color e.g. green would simply be #00FF0025
  2. Avoid that extra data and just use append in the element like this:
    Screen Shot 2020-05-26 at 10.33.29 AM
1 Like

OOOOOH this is quite the gem right here! Brilliant!! Thank you!

1 Like

For sure. Glad to help.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.