JavaScript: Making color lighter
HTML Code:
<label for="biz_name">Bussines name</label>
Color and all other properties for label element have been set in external CSS file.
Minimizing markup!
I need a JS script, which will:
a) get activated / triggered when label element is being hovered.
b) obtain a color of label element.
c) make that color lighter, of that label element (no matter what color is in question)
Color is hex! :wave:
Re: JavaScript: Making color lighter
What's so hard about this? All you will be doing is using the onmouseover and onmouseout events mixed with a custom JavaScript function. In that function, use parseInt(x, 16) to work with the hexadecimal numbers.
Re: JavaScript: Making color lighter
Problem is that I don't know, "how much" should I add or subtract from current color, to make it lighter
Re: JavaScript: Making color lighter
Any amount you add will make it lighter. Just play around with the amount until you get results you like.
Re: JavaScript: Making color lighter